"I need to find the three closest Big Rooms to a selected Big Room, then do that for all the following Big Rooms."
You can do something like the following. The first event is to select the big rooms. The second event picks only big rooms, loops over each, and then loops over all the other big rooms sorted by distance. The pick by uid condition skips identical big rooms. After that rooms_family will be the the three closest big rooms depending on the loopindex. You can then store the uids any way you like.
rooms width>32
rooms height>32
--- rooms set selected to true
rooms is selected
rooms_family is selected
for each rooms
X [negated] rooms_family pick by uid rooms.uid
for each rooms_family ordered by distance(rooms.x,rooms.y,rooms_family.x,rooms_family.y) descending
--- loopindex = 0
------ "1st closest"
--- loopindex = 1
------ "2nd closest"
--- loopindex = 2
------ "3rd closest"
--- loopindex >2
------- stop loop