This is a very tricky little problem.
The trouble with pazuzu's solution is that if one loon flees to the other side of the island, the mission will never end. You don't know to look for him and even if you did you'd never find him.
Sui's solution is better but still has a number of flaws. For example the mission could end when you are staring down the barrel of an enemy gun: there's no way of telling that the loon is fleeing and unlikely to shoot your.
My approach is to use a not present trigger, but to take control of the situation once the number of loons gets down to a certain number. What I did once was detect when the loons got below 12: at that point there were set to allowFleeing 0 and ordered to head to a certain, obvious place. Those who couldn't stand up were healed sufficiently to allow them to walk. When they got below 6, they were set allowFleeing 1 to make them run away. The important thing is to keep them moving: it makes them much easier to find. Towards the end they have orders to leave the area, which makes the not present trigger much more efficacious.
However, one of the disadvantages of this solution is that if you have a loon trapped somewhere, you return to the original problem. The answer to this, which is only appropriate in more complex and sophisticated cases, is to check the positions of the last few loons and, if they are not moving when they should be moving, do something about it with setPos. By definition you don't have to worry about the player seeing the loon vanish because if the player had seen him he would have shot him.
However, by far the the simplest and most effective thing you can do is have the trigger covering the right area. Careful examination of both the map and the ground is a good starting point, but you need to plenty of playtesting too. It's not so much that "not present" triggers are the work of the devil per se. It is poor use of them that is the work of the devil or, more likely, bad mission designers.
For this particular case, I suggest this.
- 1st wave attacks
- 2nd wave attacks when 1st wave all dead or all fleeing or reaches certain point
- Mission ends when 1st wave all dead or all fleeing and 2nd wave all dead or all fleeing. Mission end should not depend on whether the 2nd wave attack actually occurred.