What Pwnography said is correct, just rewording it a bit.
Essentially, you already have the shape there, so you don't have to spawn it.
So you walk down the corridor, pass over the shape that will eventually teleport you, it checks to see if a variable is equal to something, it isn't, and nothing happens. You hit the button, it spawns the doodads, and changes the variable to whatever it should be. Now you walk back, again it checks to see if the variable is equal to whatever, and now it is, so it teleports you.
Edit: I don't quite know what you mean by showing the shape, if what you want is to show the players that the shape is there, I imagine it's possible with a show effect, and then making a custom effect that is the rectangle? I feel like that's probably not what you want, but if it is, hey, there you go.