Help with rule: night-lights / lights auto off / remembering settings

I am hoping someone can describe a Rule Machine solution as I keep messing this up.

What I would like to do:

  1. If it is dark outside (using web Lux level) and there's no lights, turn on specific lights.
  2. If it is dark outside, and lights are already on, and no motion is detected for X period of time (delay per mode), then remember what was on, turn them off; however, if motion recurrs with X secs of the auto-off, turn the same lights back on like they were.

Here's my attempt at doing that / not working:

Many thanks in advance for pointing me in the right direction.