you can try to disableAI "TARGET" and "AUTOTARGET" but in the end, like Galzohar said, expect a big problem getting it to work perfectly.
place in on act in search and destroy / "ambush" wp, or in the switch trigger on act.
PHP Code:
{_x disableAI "TARGET"; _x disableAI "AUTOTARGET"} foreach units groupname;
now when they finnish the wp or the trigger is activated to make them move away, they will first cancel any current targets, then disable any targeting against new enemys. now they will move, they will still move awkward, like in combat etc, you can try forcing them back to careless, but usually it wont work properly.
AI will respond to spotted enemys, hiding, evading etc no matter what kind of disableAI is used.
Cheat:
create a unit of the same side as the enemys of the ambushers, join all the "retreating" units to that unit and make that unit leader.
now all units will run unaffected, since they are on same side.
Note, that they will not be fired upon either.