The Rule 4.0 docs contain a basic motion lighting example , which wouldn't do everything you mentioned in your second post but would get you much closer to what you'd want from a basic motion lighting rule and show you the general structure you need for this (a "changed" trigger with an IF THEN/ELSE/END-IF is indeed the best way to go).
However, for your specific needs: have you checked out Motion Lighting instead? It can already do what you're asking for with regards to the physical switch, and it's a lot easier to set up. If you do want to use RM (certainly possible but a lot more work), I'd highly recommend reading the docs I linked to first. Good luck!