I think that
if ($1- iswm *#ChannelName*)
should be
if (*#* iswm $1-) or even if (*#ChannelName* iswm $1-) (for only one chan)

But the best code for me to check if someone advertises a channel is to "analyze" if # character is the first char of a word.
ex. if someone writes *^&*&*#(*^(^, he doesn't try to advertise a channel smile . So with tokens identifiers split the $1- in words and check the word that has the # character if it is the first character on not smile