why would you attack a friendly unit?
Haha, I assure you, I'm not a sadist! In XPZ there are some weapons with beneficial effects. Of course, it doesn't make sense to deflect or evade a beneficial attack. If you added deflecting CQC mechanics, you'd be breaking some of these weapons.
and the other soldier should in theory be able to ignore such order
Haha, that would be pretty funny. Unfortunately, soldiers in this game are empty husks and the player has absolute control over them
If you order a soldier to throw a grenade under their feet and sit on it, they'll do it. Hmm, maybe you could create a mod where soldiers have an Obedience value, and based on this value they would sometimes refuse commands, or move in random directions. Soldiers fighting each other! Mutiny! Anyway...
As far as mod balance goes, in XPZ there's only 1 beneficial-attack melee weapon (Officer's Lash), and it's already balanced - the weapon will never produce more resources than it uses, and it already has high accuracy, so if the meleeDodge vs friendlies was removed, it wouldn't affect this weapon's balance. Hmm. I've analyzed ALL enemy units in XPZ, and the conclusion is that all the units with high meleeDodge also have high psiDefence. This means that there's 0 cases where mind-controlling a unit would counter an otherwise high meleeDodge. There's also no friendly VIPs who would would a high meleeDodge to evade any stun tactics. Well, even if such cases did exist, you could just stun them with ranged weapons instead.