Alternatively, if you get problems with the brackets, spread the 'pairs of conditions' to multiple lines, e.g.:
on *:TEXT:*:#: {
if (($chan == #SomeChannel) && (*sometext* iswm $1-)) { perform.join }
elseif (($chan == #AnotherChannel) && (*some other text* iswm $1-)) { perform.join }
}