Ah, thats all cool and all.
I see a hole though, if you set DND from the notification centre it probably won't switch the variable. My method with a persistent listener seems to be working well and doesn't add that much CPU usage, but then again on my preset most of the widgets are segmented out into App/CAgroups which cut CPU usage by a lot.
Currently typing on this site my BTT preset is at 2.5 - 5% cpu at idle. I have various safari widgets running (about three that are listening to the website) and about 9 notification widgets on, +1 for the DND handler. My Control Strip highlighting scripts are also running, there are two of them. Seems okay for me here, the DND handler isn't adding much usage.
2-5% CPU usage - not touching the bar, Running:
3x Safari Widgets (3 more segmented in CAGroups and are not active)
2x ControlStrip widgets
9x Notification Widgets
1x DND handler
I can pretty much say that the persistent DND handler is working fine. It'll probably be safe to try it out. Also, you wouldn't need the DND button to flick the variable, (which can also be a problem if it didn't change the actual DND but changed the variable) and it'll know the DND from the notification centre as well.
Also small tip:
I don't know if this is a placebo or whatever, but writing applescripts like this:
tell application "BetterTouchTool" to do something
seems much faster to run than:
tell application "BetterTouchTool"
Seems to work decently well, I'm relying on these to run my haptics engine. They check wheather BTT's haptic variables are on (using shell defaults read) and also checks a BTT variable (checks if the user has haptics on in settings) before producing a click, and they're pretty fast. You can probably tell that I need them to be fast to prevent the clicks from being delayed.