using a notifier on track-mute to write automation vol?

i often tend to, say, write a repetitive hihat that keeps repeating throughout the pattern. i often then tend to “play” the pattern by muting the hihat-channel every once in a while - and just thought, could LUA notifiers be used to detect when a channel is muted and write a specific volume automation data, then when channel is no longer muted, write a second specific volume automation data - allowing for a script to enter a “user-mute-to-automation-volume-generation” type mode where the user could easily write to automation while playing the pattern instead of clicking them himself?

I think it could be done, if the track mute state has an observable.

However I do the same thing using my Twitch tool - If you have an empty source track with zero volume on every line then you can punch it in and out and record the changes.

I should add this to the ExtendSelection/NoteSolo tool perhaps.