wouldn't using "pick by evaluate" followed by a "for each" work? Or do you mean the issue of comparing two instances of the same type?
For the latter, yes you could use an array. One idea would be to pick by evaluate, loop over the picked sprites and store any values you need. Then you loop over them again, checking with the values saved in the array.
For instance you could do the following to do something for any sprite that has another 32 pixels to it's left.
pick by evaluate
--> set array size to (pickedCount, 3, 1)
-- for each sprite
----> set array(loopindex, 0) to sprite.uid
----> set array(loopindex, 1) to sprite.x
----> set array(loopindex, 2) to sprite.y
-- for each sprite
---- array: for each x
---- array at (array.curX, 1) = sprite.x-32
---- array at (array.curX, 2) = sprite.y
------> do something
If instead all objects are positioned in a grid you can make it much simpler and faster.
Start of layout
--> array: set size to (20,15,1)
-- for each sprite
----> set array(int(sprite.x/32), int(sprite.y/32)) to 1
pick by evaluate
for each sprite
array at (int(sprite.x/32)-1, int(sprite.y/32) = 1
--> do something
You'd just need to update the array if an object is moved.