I think the reason that the AI acts as it does it that it orders its troops to move through the gate, not to attack yours. They'll only attack in self defense so the momentum of the charge is maintained and you're stuffed :P