Thats an awesome game there.
<3
AHA. FINALLY CRACKED DOWN ON THE PROBLEM OF MISSING AI.
In my game, I implemented a system of delays, where you could call a function and it would execute a specified amount of times later. For example:
delay(3,function() print 'toast' end)
would print "toast" after three seconds. There was also a third argument I made for failsafe-ness, to name the delay. I wanted to do this so if you tried to call a bunch of delay functions rapidly, it'd only execute after the same delay with the same name has ended. A delay with name "pie" can't be created if a delay with the name "pie" already exists. I used this system in delaying AI respawn time, and I keyed it in to the AI's name.
A problem would rise if you had multiple AI with the same names, you add a delay of this ai's name, and then another one dies while one is still waiting to respawn. The AI's name already exists as a delay, therefore a new respawn delay can't be created, and the AI never respawns.
I'm so glad I figured this out.