The term AI is misused here. Well you need no AI. Hey i don't want to be rude! This is just an optimization problem that generally can be solved using greedy strategy.
Alas, greedy solution means boring game: as the player gains experience he will adopt the same optimum greedy solution and your game becomes simply an advanced tic-tac-toe.
But don't worry! Let's talk about your problem and the possible strategies.
Here the (greedy) solution is to build as much strong-superpower-invincible-lastlevel unit as possible, because this kind of units overwhelm the others in term of power. Normally those units are slow to build so your base is left undefended until they are ready so your opponent can build a single demolition-unit and "the white wins in a move".
Then you start to think to build some "lower-level-but-faster-to-build" units before start to build the "final-weapon". This is still a greedy solution: you simply put a "defence" parameter in the objective function to minimize.
In general you should model your objective function leaving room for such parameters and let the computer to choose among a pre-fixed set of parameters or to choose randomly.
This gives to your otherwise booring optimum finder algoritm, a sort of character, a personality.
Once those parameters are choosed you should simply apply your favorite optimization algorithm.