It appears I made a number of errors in the script above... wow... Here's a version I've just tested working.
_minx = (getPos ((_this select 0) select 0)) select 0; // X-coord of top-left cone
_miny = (getPos ((_this select 0) select 1)) select 1; // Y-coord of bottom-right cone
_maxx = (getPos ((_this select 0) select 1)) select 0; // X-coord of bottom-right cone
_maxy = (getPos ((_this select 0) select 0)) select 1; // Y-coord of top-left cone
_soldier = _this select 1; // Soldier position
// Wait until soldier is in the area.
while {true} do {
scopeName "loop";
_sx = (getPos _soldier) select 0;
_sy = (getPos _soldier) select 1;
if( (_sx>_minx) && (_sx<_maxx) && (_sy>_miny) && (_sy<_maxy) ) exitWith {
hint format["%1 is in the area!", _soldier];
};
};
While I'm at it, I'll just mention what was probably obvious, this will only work for square areas on a square angle (e.g. 0, 90, 180, etc.) - other angles need a more complex approach.