How can I maintain switch state when in sleep mode? I'm using a esp8266 to build a remote control to power a gas fireplace. I'm using this guide to try and maximize battery life.  

The concept is the controller uses its built in WiFi to access a RESTful API on a remote server; If the API discovers"1", it should close a switch and the fireplace turns on. If the arduino reads a "0" via the API it opens the switch and the fireplace turns off. After discovery and performing the required action the unit calls Deepsleep and shuts off for ten seconds, whereupon it powers up and the cycle repeats itself again. 

I just realized that if the controller powers off, I don't know what happens to the switch. If the fireplace was turned on,  what happens when deep sleep starts. Is there a way (special switch?) that maintains its state in deepsleep mode?
You can get a latching relay. These come in two flavours - Unipolar, where you energise one pin to turn it on, and energise the other to turn it off, and Bipolar, where the direction of the current through the coil turns on or turns off.

Unipolar is easier to drive since you just need two transistors, diodes and resistors. Bipolar is harder, since you need a H-bridge (motor driver), but requires less wires to connect it up (2 as opposed to 3).

In both cases it is just a short pulse that is needed to switch the relay into a different state - there is no need to maintain the output, so is ideal for deep-sleep mode where everything is turned off except the RTC.