Well i tested it.
I made an AI to build up things with run AI script and gave him resaurces and stuff.
But if you do a "give all AI player units to you and then back to AI player", then AI player just stands there like no AI script is running. Maybe it's a known fact, but id like the AI to play after giving him back the units. Is it possible ?
Try redoing the AI scripts after you give the units?
How an AI script works is the ai is told to build units, a building, etc...in a certain order, mine, upgrade, etc... Then at a certain time there told to prepare to attack(gathering of units), then there told to finally attack and it just loops a good amount of this.
When you give all the units away the AI probably thinks its dead and therefor stops all loops because it can't complete the loops.
Otherwise try just letting the AI keep a command center or something.