There are some things that you can do that will make your rule a lot more efficient. First of all, you have the motion sensor being active as a condition twice, this is unnecessary. You can move all of the sub-actions in the second active under the first without a problem.
The second problem is that you have the light that the rule controls being a trigger of the rule. This is unnecessary. Turning the light on should not trigger the rule again. If the sensor goes active and the light turns on, that in turn will trigger the rule again with no real affect taking place. So, I would recommend removing that a s a trigger in the rule.
So, I would recommend that following:
If Motion Active Then
Cancel delayed actions
If Time is between x and y and mode is home and lights is off Then
Dim light to whatever you want.
Else If motion is inactive or mode is a or b
Then turn off lights after delay Cancelable.
I would also recommend having a longer timeout than 3 seconds. That isn't much time to have between motion triggers to keep a light on.