Code to not turn lights off that are already on

Then this approach probably will not work. What would work is some disable logic that prevents motion-off from turning the lights off. That would typically be done with a virtual switch. The next question becomes how to turn the virtual disable switch on and off.

If you have an Echo, that would be one way to do it. Another way would be to use a Minimote. Another way would be to use the mobile app, or SmartTiles. Do any of those make sense for you?

If you use this app linked below for Motion Lighting, it has the disable logic in it. The issue to solve is the one above.