You know how squads of dwarf have a tendency to split up and hit the enemy in small waves instead of all at once? I've programmed a couple AIs in my day, and there's a simple way around that. Instead of having different units each operate independently, each unit is basically given commands by a Leader unit, or bases their decisions on the position of the leader. So instead of thinking "Attack the nearest enemy" the unit thinks "Attack the enemy nearest to the leader" or instead of "move to the station point" only the leader moves to the station point and all other units move to the leader. For the Patrol and Defend orders, it would make more sense for them to split up, so there should be some way to activate and deactivate follow-the-leader AI as needed.
If you'd prefer to get messy, there are more complicated ways to program units to keep cohesion, you see them in robotics demonstrations a lot. Or, more appropriately, you could program the leader to make decisions and give commands. For example, the leader might see a troll and a goblin nearby. Leader has 6 subordinates nearby, so he sends 4 to fight the troll and 2 to fight the goblin. Herein lies the danger of that approach though, is a troll actually more dangerous than a goblin? An armored goblin lasher is probably way more dangerous than a troll.
Alternatively, the "leader" does not need to be an actual unit. For calculations' sake, the "leader" could be the squadron's mid-point or the point marked as a station command.