Doesn't you not need script at all to emulate this? EDB and limited numbers of unit per building (= per city size), and very low or off spawning frequency (not like vanilla's 0.5-2 units per turn) can do it too.