Reasoning:
If you have many groups, to iterate though all takes very long (even with the new groups <side>) - for perFrame execution filtering per SQF is very expensive.
nearGroups would look for any unit within the radius - not just the leader, and would add that group to the return.
Suggested format:
_groups = position/object nearGroups distance; _groups = position/object nearGroups [side,distance]; _groups = position/object nearGroups [[sides],distance];
Return Value: Array of Groups - not sorted
It should also exclude non simulated groups.