#MyChannelBlocker off
ON *:INPUT:#MyChannel: {
halt
}
#MyChannelBlocker end

Then just use /enable #mychannelblocker to turn it on and /disable #mychannelblocker to turn it off. Change "#Mychannel" in the ON INPUT statement to the name of your channel.