Recovery last scene after motion

Hi
I would Like to Setup room with motion detection like this:

A.) If there ist no motion for 600s then reduce light to 10%

B.)If there is motion and light ist on, recovery last used scene (if that not possible, a time based scene would also be an option)…

A.)ist an easy task, but with B.) I struggle

Kind regards Stephan