Hi Chris,
if you modify the circuit using a comparator you won't have to care if you are using battery or mains power. Adjust the comparator so it will disconnect the battery if it is depleted and automatically switch to mains power supply and route the power to the circuit using a relay.
A second way would be to keep the battery connected to mains power supply at all times not exceeding the max charge voltage and operate the device in buffered mode. (Don't forget to use an extra diode to prevent current back flow from the battery into the power supply in case mains power fails.)
Boncuk