Well to swap the position of two instances of the same object you’d pick one and save the xy to variables. Then you’d pick the second one and save its xy to other variables. Then you’d pick each one again and set the position to the saved variables. However, you could simplify that a bit to use less variables.
Basic swap logic would be
Temp=a
A=b
B=temp
But the main busywork would be picking.
Picking each instance one at a time can be tedious and require a lot of events. However, if you add two instances of a helper sprite on the layout and call it temp, you could do this to swap instances with minimal events. You also need to add a swap instance variable to the blocks.
Mouse: left is down
Mouse: is over block
Block: pick instance 0
— block: set swap to true
On mouse: left released
— block: set swap to false
Block: swap is true
Compare: block.pickedCount = 2
— temp: set position to block
— block: set x to temp(1-temp.iid).x
— block: set y to temp(1-temp.iid).y
— block: set swap to false