Set up your waypoints for the AI group. They will look something like this
MOVE twards objective
HOLD at the objective
MOVE run away back to base
The hold waypoint goes at the place where the opposition gets too bad. Now create a trigger
activation: see below
type: switch
Syncro the trigger with the hold waypoint. The AI group will stay at the hold point till the trigger is fired, then they will move onto the next waypoint.
Activate the trigger as you like: you might want to count the number of loons in the group and make them retreat when it gets too low, or maybe use knowsAbout to make them retreat when they spot incoming tanks. Whatever.
It might be worth using allowFleeing 0 to prevent your loons from running away too early.