What exactly is this "channel detection" meant to do?

If it is anti-advertising then just nail something like this:
Code:
ON *:TEXT:*:#: {
  if ($chr(35) isin $1- && # !isin $1-) {
    kick # $nick No advertising!
  }
}