Using Motion Sensor to turn on a light, and contact sensor to turn off a light after door is opened

If you're going to do this in RM I don't see a need for a private boolean. You would use 'cancel delayed actions' on the light going off.

If you want some rule machine examples here is a thread that discusses this. There are a whole bunch of other discussions regarding this as well.