Ok, just so that I put my money where my mouth is (and I don't appear like an obnoxious bastard belittling other people's work), here is all the AI-related code I could find in Granto's OiM script - which I believe was taken by Germanicu5's ReallyBadAI.
What that does is: Every 30 seconds or when an AI-controlled unit is attacked from the flanks or rear by a player-controlled unit (and 30 seconds have passed from the last time that happened) the AI is switched off and then on again.
and I_TimerElapsed battle_timer > 30000
monitor_event BattlePlayerUnitAttacksEnemyUnit BattleDirectionOfAttack != front
and I_TimerElapsed battle_timer_flank > 30000
So, by turning the AI off and on again, every 30 seconds, the AI somehow learns to split its forces, and flank, and time its charges, and manoeuvre better? I must say I'm sceptical.