What causes those scripts to be run? Is it done for overall military strength, or strength/army, or some other reason? If so, could the unit value be kept as a separate value and changed whenever something changes the unit (spells, XP, damage, etc)? Then, for example, if someone casts a global spell that has a chance of reducing Defense by 1, it need to check every unit in the game, but thereafter it doesn't need to run a script every turn to calculate the unit's Defense. If that method accumulates errors, then an occasional 'recalculate unit values' might need to be done.
I'm not a programmer, but I get the impression that there are various tricks that can be used to reduce the number of "If Then's" that need to be run to do a task. Some trade off memory space for speed; some might use data structures and addressing modes (maybe not available in the scripting language). Some might trade off precision for speed, such as not requiring ten decimal places of accuracy for deciding whether to attack an army. I think a lot of the 'done every turn' checks and calculations are not really necessary.
I'm not a programmer, but I get the impression that there are various tricks that can be used to reduce the number of "If Then's" that need to be run to do a task. Some trade off memory space for speed; some might use data structures and addressing modes (maybe not available in the scripting language). Some might trade off precision for speed, such as not requiring ten decimal places of accuracy for deciding whether to attack an army. I think a lot of the 'done every turn' checks and calculations are not really necessary.