I see. It looks a bit better now, but you don\'t really need the loop. You can just use mIRC\'s $fline:
alias nick.s { if ($fline($2,$+(*,$1,*),2,1)) return manymatch elseif ($fline($2,$+(*,$1,*),1,1)) return match else return nomatch }