You can have private variables for the Switch and Door objects (one of each, then place lots of them in the layouts) to pair them.
Then compare this in the events Eg:
For each Door
-Subevent> Switch value "DoorNum" = Door.value("SwitchNum")
You can then use different animation frames for different door and switch images and change this in their properties, or use a variable again to set it in-game.
Edit: Ah, just saw Tulamide's post. Nice solution!
Double edit: Oops, I just realized containers and an "On" variable on the Switch will probably work here too! <img src="smileys/smiley9.gif" border="0" align="middle" /> That's probably the easiest method, just have Switch in the container of Door and then:
For each Door (or Switch, shouldn't matter which is looped through)
-Subevent> Switch value "On" = 1, open door
-Subevent> Switch value "On" = -1, close door
Then, when the player uses a switch, just change its value of "On" to "On * -1"