Not sure how you exactly create/destroy them.
tmntppn's example works perfect because event 9 is actual a new 'root event'
If you create and destroy in the same event, and if you 'pick' those that you want to destroy in that same event, then you might suffer from that 'unable to pick newly created objects before the next 'root event' thingy.
You have 2 options.
1/ Or, do not create the one that you initially want to destroy.
2/ Or. Destroy in a new root level.
For method 1, you need 2 local variables. Initiate them before the loop that creates things.
1 local that you give a random variable in the range 0 to 3. 0 = top ... and so on.
1 local variable that gets a random index, in the range depending on if you make a horizontal or a vertical row.
Now, if loop index it matching the random index and if that first random is matching top,left,right or left ... do not create that block.
For method 2, you can do exactly what tmntppn suggested. A new root event.
Pick all blocks with 'pos' = choose("left","right","top","bottom")
Pick a random from that picklist, destroy it.
Another problem that i see is this. You might be using a loop to create more then 1 of those 'rooms'. (also a gamble). So you have ...
Loop for x rooms
__Loop for up
__Loop for down
__Loop for right
__Loop for left
Now you cant escape the 'room loop' to a new root level to destroy as you want. I can imagine.
Then i suggest to just not create them.
Here is an updated version of tmntppn's example for method 2 (destroy in new root level event)
https://www.dropbox.com/s/quj1lilua3ve4 ... .capx?dl=0