Digital design is not my forte (to put it mildly), but... What about using a low-power CMOS chip to store/define the state, and powering this from a small battery, like a watch battery? As long as the memory is stored on a chip which uses very little power...? The output could feed buffers powered from the power supply.