Should a UPS be unplugged when working on the electrical circuit it is plugged in to?
The UPS battery won't be backfeeding into the house service. DC current won't be flowing back through the rectifier diode.
I'd be more concerned about doing something wrong with your switch replacements, turning on the power and frying your UPS board. We see this happening all the time here. Play it save and unplug the UPS and anything else on the circuit while you're working on it.