I too, know nothing about scripting, I can write pseudo-code for missions, but I couldn't convert it to actual code. One thing that sticks out though, is the adaptive AI. There's a number of things that the AI does that makes me facepalm. But rather than having the AI learn on the fly, it should be set up that the game sends "performance" reports to a central location, where people can say... well, this is a weakness of it, we need to address this. This was just the player making a monumental mistake (either intentionally or not) the AI SHOULD NOT be trying to take advantage of that. (One thing that just popped into my head was the Player purposefully dropping their forward shield when they finished charging their overloads to coax the AI to make a move to attack the downed shield, which, ordinarily would be a good tactic, but with the player ready to unleash a full alpha strike, would be a very BAD tactic. And then a possible fix to said tactic, the ability to remember things like weapons statuses and shield strengths going back a couple of minutes, so that if a shield went from 30 to 0... the AI should smell a trap, unless said shield just got hit by a 50 point Plasma Torpedo.)
The AI being able to guess as to when a weapon was ready to fire again would be a big help, if the Player just launched a volley of Photon Torpedoes, the AI should be able to recognize that it has two turns minimum before those weapons can be fired again, and move to take advantage of that. I think adding Memory ability to the AI would be a massive upgrade, so that it not only is trying to determine the best tactic for the moment, but so that it remembers what happened just a couple of minutes ago, and uses that to build on that tactic.
I think the easiest way to record it (again, I have limited programming experience) is to track every weapon that has a arming time of LONGER than 1 turn. Phasers, Disruptors, and most Drone Racks are not tracked. As soon as the AI detects the Heavy Weapon (either by sensors, or the weapon firing) it puts a timer on it, that timer is equal to the amount of time it would take to charge at that game speed. (so a real time game would set a Photon Torpedo timer at 60 seconds) While the timer for the weapon is greater than 0 the AI would act more aggressively trying to take advantage of the fact that the weapon is still loading. Once the timer reached, say 15, the AI would go into a defensive posture, ready to counter the Plasma Torpedo that could be launched as soon as 15 seconds. The number can be updated through Tac Intel, so if it gets close enough to tell that the Player (or other AI) isn't charging their Heavies as fast as possible, it can reset the timer accordingly. A threshold would have to be set, based on the AI's ship size (and possibly damage state), as to how much heavy incoming fire it would be willing to take. So that if someone decided that they would just be charging one Heavy, or holding a single Heavy in reserve just to keep the AI on a defensive footing, the AI could determine, that it was willing to take a single Photon, even an Overloaded Photon, to close on the player while he's reloading the other three. Or that that F-torp that's loaded and ready just isn't a big enough deterrent to keep my fully shielded cruiser from closing and hosing, but if I don't get in in the next 45 seconds, the Player will have that big nasty R-Torp ready for me...