Ok I tested it out and I had to change some code around to make it work. For testing I just call from radio trigger to start the script.
_squad = testgp1
leader = testdude1
;======================
#Start_SAD
_squad SetCombatMode "RED"
_x= getpos leader select 0
_y= getpos leader select 1
_t= daytime
#Loop_SAD
? daytime > _t+180/3600: goto "End_SAD"
_r= random 100
_phi= random 360
_squad move [_x+_r*sin(_phi),_y+_r*cos(_phi)]
#SAD
;-------------------------------
; unit is on its way to the new S&D point...
; you can let do it here somefink - like react on
; knowsabout values, emergency "exit loop", etc..
;-------------------------------
~1
? ("unitready _x" count units _squad)!=(count units _squad):goto "SAD"
goto "Loop_SAD"
#End_SAD
;========================
I added the variable at the top to define the groups and leader.
Now to make the code work I had to remove the y= select leader _squad, it was returning an error, group expected object. Not sure why you are selecting the squad pos and the leader pos, these would nearly be the same, or is this how the randmizing happens.
Either way it seems to be working ok, I am going to test it some more.
Thanks again for the help.
hoz