I wrote this quickly little addon for a friend who ALWAYS forgets to leave a raid before questing and has (obvious) issues. It just pops up a simple box when you kill a mob or enter a vehicle while outdoors in a raid (not counting hostile or friendly major cities). If you did it on purpose you can just click "remind me next raid" if you click "remind me later" it won’t bug you for another 3 minutes.
Unfortunately there is no practical way to detect when someone is attempting to interact with an object that is "non raid" only.