You can do that by cloning the Keylights profile. Then edit the profile where it says Variable Value. Change it to activate when it Doesn't Match and set the value as "Off". This way the profile is active for Go and Go2. Delete the Exit task. Then edit the Enter task. Delete all the entries except for one of the wait tasks and the set variable task at the end. Make the wait into the timeout time. Change the set variable to "Off" instead of "Go2" and remove the if condition. Hit properties and for collision handling set it to abort existing task.
Now when your lights start flashing, this second task will begin the timer. If the time runs out, it will turn off the lights. If you wake your phone before that, it will harmlessly count down. If you wake your phone and then get another notification, the old countdown timer will be aborted and a new one will start.
Still not ideal. I did a test, and running the flashing lights using this method drains about 6% an hour. Using the Keylights app, there is no noticeable change from the usual 1% an hour.
Now when your lights start flashing, this second task will begin the timer. If the time runs out, it will turn off the lights. If you wake your phone before that, it will harmlessly count down. If you wake your phone and then get another notification, the old countdown timer will be aborted and a new one will start.
Still not ideal. I did a test, and running the flashing lights using this method drains about 6% an hour. Using the Keylights app, there is no noticeable change from the usual 1% an hour.