Try
old = ""
cnt = 0
def seq_count(val):
global old
global cnt
if old == val:
cnt += 1
ret = "{} {:04.0f}".format(val, cnt)
else:
cnt = 0
ret = "{} {:04.0f}".format(val, cnt)
old = val
return ret
__esri_field_calculator_splitter__
seq_count(!Test!)
You can save this as sequential_count.cal and load it into the field calculator and it should split the code block (lines --1-13 from the expression (line 15). Just remember to change the !Test! fieldname to match your field containing the source data.
If you prefer to copy/paste/retype, then put lines 1-13 into the code block and line 15 in the expression