Yes, as annoying as it is to hunt the last one, they can also be quite dangerous, both because they can cheat and because one tends to get sloppy at the end.
I like the "has no weapon and none in immediate LoS" check, as that's a good way to check if the enemy is still dangerous. Maybe a "hasPanicked" flag for battlescape units, which must be true for the unit to be allowed to surrender?
Another thing that was discussed before was a "can surrender" property, set to false by default in unit definitions. This allows modders to decide which units can surrender (GOs, Hostesses, Researchers, etc. Maybe none of the church because they are too indoctrinated) and which can't (chryssalids, mercs, etc.).
If only units that can surrender remain, and less than X% of the starting units remain, then a surrender occurs. Can add the "has weapon" check, but since it is possible to keep a weapon when panicking (ex.: by going berserk), I think the "has panicked" check might work better.