First, make the actual switch. You can do this with a simple ellipse, but feel free to experiment with the shape. Give it the "Floor Touch" sector special, and give it an unused tag. Next, place a control sector outside the map (it can be in any shape.) Give one of its linedefs a Linedef Executor action ("Once" is preferred), and give it the same tag as the switch sector. Next, give an adjacent linedef either the Move Sector Floor action or the Move Sector Ceiling action, and give it and the door another tag. From the image, it looks like you'll want Move Sector Ceiling.
If you need a different explanation, feel free to check
the wiki page for the linedef executor tutorial.