Its actually a bit of a pain to find which enemy are within a certain range - you need to cycle through all the enemy units to find which is nearest. Heres a quick example:
First set a a trigger covering the entire map area. Make it East Present, and in the On Activation field put:
eastlist = thislist. This creates the array of units you will check.
Next run your script.
;inrange.sqs
#start
;set the minimum distance
_distance = 100
;set the parameter to control the loop
_i = (count eastlist) - 1
;check that there are still units in the east list
? _i < 0 : hint "All east units are dead"; exit
#loop
~0.1
;cycle through all available units
_unit = eastlist select _i
;check if the unit is in range
? _unit distance man < _distance : _victim = _unit; _distance = _unit distance man
;get the next unit
_i = _i - 1
? _i >= 0 : goto "loop"
?_distance < 100 : [_victim] exec "your_next_script.sqs"
goto "start"
At the end of each loop the script executes a secondary script using the closest east unit, if that unit is within range.
There may be an easier way of doing it, but this is the method I use.
Cheers