If you want to properly trigger the track mute (including halting effects processing to regain CPU), that can't be done from JSFX.
If you're just looking to cut the audio in/out to make rhythms/etc, I have a
MIDI Gate plugin (
REAPER Blog tutorial) which might be useful, depending on the flow you want.
Geraint