I think it should work like that, but just BTW there is an "ELSE-IF" option you can insert from within the menu.
The capture and restore is pretty easy, its in one of the action menus. Here is a little example I found basically doing the same thing you are trying to do:
And here is an example from one of my rules where I am setting the lights for my robot vac, then restoring them when its done.