I'm doing something similar with about 20 devices so am only going to 25% increments for the dimmable ones to cut down on the number of programs (i.e., Off -> Off, 1-25% -> 25%, 26-50% -> 50%, etc.). My goal was to restore the prior state after turning off a scene.
However, I'm not storing the state of the devices in variables but instead in a dedicated "Prior State" scene using Adjust Scene when the associated devices change state. I feel this is a more simple (don't need the multiple "restore the status" programs for each device / dim value range, not to mention all of those pesky variables), durable (survives a power failure) and aesthetically pleasing approach -- I just have to turn the "Prior State" scene on just like any other scene and that's it.