Berserker, amazing work! I just added this post to my bookmark. This has to be read every time I start scripting!
A few questions:
1. This is supposed to be a single script mod. Say the mod is called Ensure Towns are Guarded, what do you suggest the main function to be named? prefix "etag", full fucntion name FU(etag_Main)?
2. Somehow I still like my !!co 2 line, I feel the logic is clearer (with comment).
I'm confused with your last loop a bit. (SlotInd:y) was fixed in the range (ARMY_SLOT_FIRST) -> (ARMY_SLOT_LAST) from the previous loop, but in the last loop you checked for the condition when SlotInd > (ARMY_SLOT_LAST)