Well, I'm not very good with AIs but I can suggest you a pair of things that may be useful:
1- Make sure the waves have some delay: this will give the AI the time for building up its army again.
2- Check the AI options: Group Retreat can make the AI to fall back the enemy has too many units (even before it starts attacking, I guess... my AIs did something like this) if.
It may also be both of the two possibilities: maybe the AI doesn't even attack because it has a 0 seconds delay from one wave to another and the enemy has more units than him...
That's the best I can thing now, hope it will be useful for you!