Here's the task I had created. Once you create this task you can then just create a widget to place on your main screen for the on/off switch. Also, you'll need to set up the profile on post #9 to accompany this.
The set tasker icon basically puts a lock icon on the notification bar. This is so that I know if the DnD is turned on or off.