You could make a global variable for the number of pillars on screen and when it equals 0 or less the gate opens/destroys.
I did something similar with random enemies on screen. I made it spawn a random amount so i never knew how many would be there. The way I made it all work out is I just had the on start event add 1 for every enemy, then I made the door open when the number of enemies was 0.
I'll try to make a quick demo for you, hope this helps.