currentCommand provides the ability to check what order is under execution by a given group member(s), namely:
"WAIT","ATTACK","HIDE","MOVE","HEAL","REPAIR","REFUEL","REARM","SUPPORT","JOIN","GET IN","FIRE","GET OUT","STOP","EXPECT","ACTION","ATTACKFIRE"
but there is no scripting ability to bypass such orders. While units have such orders they become unresponsive to any other routine which might have higher priority for the needs of the scripter/mission maker.
doFollow group leader (as scripting equivalent of "return to formation") does not release the unit to receive further (disparate) orders.
enableAttack true/false only goes so far in dealing with this, naturaly not affecting other orders.
adding to the issue is the fact that, in some circumstances the engine provided routines above may bug out or misbehave, or generally speaking, constrain too much how such orders would be fulfilled.
Hence the need for a script command that allows the ability to suspend/terminate such orders.