Here's my suggestion:
look for the 00. if the letter before the 00 is _, do something. This will make it easier for the user, as names can just be changed permanently rather than have "Moscowaaaaaaa" it will just be "MoscowA" or something. and is only 1 or 2 more lines.
check # of units in che city (I haven't looked at the hex-editing stiff in a while, is this possible?) if # of units < x, build a Red Guard (or something).
have prog change name back after function is complete