There's an example in the docs that shows almost exactly what you want, so I'd take a look. In short, you'll need to change your trigger ti changed, add an ELSE with a delay and your off action, then add some magic to cancel the delays when active again: [Released] Rule 4.0
That being said, if this is all you're doing in this rule, is there a reason the stock Motion Lighting app won't work for you instead? It's a lot easier to set up and was designed for automations like this. No need to make it harder. 