welll from the first question, you may better use the distance command...
obj1 distance obj2
Operand types:
obj1: Object
obj2: Object
Type of returned value:
Number
Description:
Compute distance between two objects.
Example:
player distance leader player
Use it like putting on the "Condition" field of a trigger something like loonA distance LoonB < 5
and for the other question,
Make a trigger, and set it to Ausent, and the side you want to kill, and put it covering wolle area, and when there aren't more units of that side on the area, the trigger will be activated...