To do this, you'll want to create a new Parallel Process event. In that event, assign variables to the object's Map X and Map Y. Then use a Conditional Branch and check if the variables are equal to the switch's coordinates. If they are, turn on a switch; else, turn off the switch.
Now in the switch event, you can create a new page where the switch is down (with the Condition that the aforementioned switch is on). You can open the door and add other commands here, which will only activate when the object is on the switch.
Good luck with it!
EDIT: FireRaven typed up a good example of commands below, so you can see that if you're still confused.