I'll have a shot at this for my first post ;)
private ["_iedpos","_spd","_distance","_cond","_dis","_speed"];
_iedpos = _this select 0;// comes from a calling script
_speed = [0.5,0.8,1] call BIS_fnc_selectRandom;
_distance = [3,5,6,8,10] call BIS_fnc_selectRandom;
_cond = false;
{
_dis = _x distance _iedpos;
_spd = speed _x;
if ((_dis <= _distance) && (_spd >= _speed)) exitWith {_cond = true;};
} forEach ESCORT_Units;
if (_cond) then {
//CODE HERE
};
havent tested this, hope it helps