Perhaps coding some sort of 'formation' that each army uses when placed on the tac map would force the AI to keep each sides forces together when setting up the initial placement?
This is my favoured solution. In addition to the idea that stave-wielding mages should be placed at the back where they belong, I like the notion of the "Battle" button giving you a quick prompt where you can choose between formations like:
"Aggressive" - Melee units start pushed up in a staggered tactical formation wherein every unit can squeeze through a gap to engage on the enemy immediately. Ranged units in a loose formation at the rear. Good for when you want to be able to go all out from the get-go and screw the counterattacks.
"Defensive" - Melee units start pushed back near your ranged formation, in a close-packed defensive cluster. Good for a cautious approach to massed enemy hordes.
"Disperse" - All your units are spread out in a loose formation (a lot like what happens already). Good for fighting AOE casters.
"Flanking" - Your units are spread more or less evenly between two columns, ready for a pincer-movement or a dual defense. This may only be available on some tactical maps due to space limitations.
These would add tactical depth to the combat, remove the frustration that the current, practically-random formations cause, while preventing tedious manual placement and player-AI imbalance, as the AI would be subject to the same choices. I don't know much about how coding works, so I don't know how difficult this would be to implement, but it's a very important issue to address as it is mine, and evidently several others', largest perpetual issue with the game as it stands.
I of course also think it's important to maintain "ambush" situations or surprise attacks wherein your guys get taken by surprise and end up arse-backwards all over the place, but the rest of the time a degree of control would be really beneficial.