You have a couple of different things here:
If the lights are already on and motion is triggered, I’m assuming you want nothing to happen with your lights set the way they are, correct? If that’s the case, then I would make your Piston NOT fire unless Motion is Active and the Lights are currently off (If they are on do nothing).
if 1 above is correct, then your Piston fires only when Motion changes to Active and the Lights are off. Included in this Piston, you always want your lights to come on in a specific color and brightness, correct? If so, by replacing Turn on Lights with your DO function, use Set LIFX scene you have predefined in LIFX instead, and then with a wait x minutes and then turn off.
If you want them to be another predefined color when they are manually switched on, you could add a different LIFX scene just before the lights turn off in that Piston, so that if someone turns the lights on from a switch (manually) then they will be that color/brightness when turning them on. Otherwise if #2 fires again, it will set to the default Motion scene with color and brightness stored in that scene.
With Motion detected, I’m assuming there is a set standard color and brightness of all the lights, like pulsing ALL red for 30 seconds or bright white for 2 minutes.
I might be missing something in your use case and I apologize if I am, but this should get you pretty close to doing exactly what you want without the lights actually going back to a previous saved state.
As for previous state, you might be able to store values of the current color and brightness in variables within webCoRE and then recall that as a restorable set of values. I haven’t done that, so not sure if it’s possible to do.