Sorry, but I don't really have enough time to go through and answer every question or issue in this thread, so I'll just address what I remember:
1) Do not use WR1 in the SaveForUpgrades table. This forces the AI to save immediately, meaning it will only purchase cheap items. There is no reason to do this for FS1, as it's cheap enough that a simple Validate.CanPurchaseUpgrade check or a raw gold check in the goal update thread will suffice.
If you've significantly modified the SaveForUpgrades table, post it - the only kinds of things that should be in there are extremely vital, higher-cost upgrades like Currency I (and maybe II), and creep upgrades. You don't want to force the AI to save for too many things or at the wrong times, or you get very undesirable behavior (as with the old system).
The AI WILL buy citadel upgrades that it's not specifically saving for even during a normal shopping trip - they just need to be available (enough gold etc) and high-priority enough. If you're already forcing the highest-gold AI to return at WS2 to get FS1, and the upgrade itself has high enough priority, that should be all you need. It's obviously going to have 600 gold, and there's no reason to try to force it to start saving at the beginning of the game.
2) Anyone testing this mod should be running with a log file (add '/log ..\AILog.txt' to your Demigod shortcut's commandline, which should create an AILog.txt in the main \Demigod folder). If you run into significant problems like stuck AI, serious slowdowns, etc, put the log contents on http://www.pastebin.com and include the link in your post.
3) The stock AI already produces a significant sim/CPU drain, and peppe's version of the mod made this a bit worse due to more checks being run more often. If you've modified timer values, this could be making the problem worse. If there are no significant log errors during test games, then dollars to donuts it's some long sensor/goal update/etc process running more often than it was before.
I would strongly recommend you make external note of any timers or weight values you adjust, so that it's possible to troubleshoot this. If you can't recall which you've modified, it may be worth doing some file compares against peppe's version (at least the _AIAction files, and maybe the unit sensor files).
MIRI - anyway I can get a count of AI players on my team? Looking to make conditional logic to purchase certain upgrades ONLY IF I have X number of teammates or X number of teammates at X level (by level I mean easy/normal/hard/nm).
Getting this information is simple enough, but using it properly is much more difficult. Where would you put the checks for this? It would have to be fully integrated into every part of the shopping decisionmaking process, from goal picking, to saving, to actual item/upgrade priority. Like I said, getting the AI to shop at the right times for the right things really requires a huge overhaul of the goal picking/shopping logic, as having it do dozens of similar checks at every step is not only redundant and increases AI sim burden, but has a chance to produce conflicting results, making it get stuck in a loop like you're seeing happen.
If you're just using this for upgrade/item priority, then it's probably workable, but the information should be cached in a table in AIGlobals anyway.