Explanation
In this example a simple Trigger has been created to change the Close Date of an Opportunity, that's about to be inserted or updated, to a date 10 days in the future.
The Apex Controller custom setting's checkbox field enables the code to be disabled at the user / profile / org level.
...