Is it possible to run widget AppleScript only when BetterTouchTool becomes visible?

By default my Touch Bar shows the expanded control strip, so I have to press Fn to show BetterTouchTool.

I have a custom now playing widget that shows the name of the currently playing iTunes track and whether the song is already in my library. I was wondering if it would be possible to only run the AppleScript associated with this widget whenever I press the Fn key to show BetterTouchTool, instead of it (inefficiently) running every five seconds in the background?

If not, I think this would be a great feature if the framework allows for it!