Maybe a "flee" condition would be better than a "surrender" one?
With either, you potentially escape the deadly encounter with the last enemy, when you finally encounter it. However, with a "flee" condition, the enemies just leave with everything they carry, thus reducing the reward, compared to the "surrender" condition giving you captives for every unit left, which is the best possible reward (captives being the best kind of way to take out enemies). There isn't much of a choice if the enemy offers surrender. There's no downside to it except that you can't exploit training xp on the last few units (which isn't much of an issue with the gym).
By opposition, a "flee" option gives you less reward for the diminished risk since you lose the opportunity to capture/kill/loot the fleeing units. This way there is a cost to the option. Make enemies flee automatically if a certain % (based on the average bravery of the remaining units?) have been killed and there has been no encounter with the player's force for X turn (meaning the player lost contact) instead of a decision for the player and you get an extra incentive for not camping. Why the hell would GOs and researchers sit around if you deploy, hide behind smoke and wait to snipe them? You're not following, so they should just run for their lives and get the hell away from the crazy gals with big guns!
HWPs are either more or less mindless or are remote controlled, so self preservation shouldn't be an issue for them and thus they won't flee. Basing things on bravery becomes more believable (if you have a tank/monster still kicking on your side, you're more likely to think you can make it). Or they simply don't disappear when the fleeing units run away.
In fact, if the % and fleeing likelihood were checked for each units, you could do something like:
- Beginning of enemy turn: calculate the % of units remaining
- Upon activation of a given unit, check if unit panics:
- If the unit panic and there are more units than (100-bravery)% of units, panic as usual.
- If the unit panics and there are fewer units remaining than (100-bravery)% of units, unit drops what's in its hands and runs away (unit is removed from the battlefield with all it still carries) (could be limited by requiring that no player units see this unit or having another check with a % chance to run away, something like 100-Current%/Treshold%, so the fewer there are, the more likely units are to run away instead of panicking).
- If the unit doesn't panic but there are less than (100-bravery)/2 % units left, loose some morale. This avoids the "I'm the last one of 20, but nobody died recently so I'm invincible!" syndrome. Over time, this may make isolated but otherwise brave units run away any ways, as even the most iron willed soldier should eventually recognize defeat. The truly brainwashed can be given bravery 100+ which makes it impossible for the unit to flee (can't have less than 0% of units left if that unit is left))
- Otherwise (no panic, lots of units left) business as usual.
Doing this, you get rid of the annoying last GO/Researcher/Neophyte sulking in the toilets (but also lose their loot/ransom, although that's not much of a loss), but the last chryssalid/merc is likely to stay and mess you up. And you get situations like Researchers running away while the Osiron security guards and cyberdiscs cover them. You can also use the mechanic with animals (scorpions? And some of Solarius' beasties in the XCom-Files potentially) as they would flee from danger, even though surrender makes little sense for them.