I can dig it…but surely the simple option is to have the PC wake up on power restoration, right?
After the PC shuts down, the UPS runtime will increase by a lot. So the power might come back before the UPS turns off, so as far as the PC can see, the power was never lost.
Edit: Also I assumed you meant restore on after AC loss, and not the last state.