I was just pointing out you had the operand backward inside the condition:
if (v1 isin v2)
isn't the same as
if (v2 isin v1)
You also had a typo where $chan was used instead of $chan(%m), I used $comchan to avoid the check with 'ison' and rearranged the loop to get the script smaller:
alias modeu {
var %m 1
while ($comchan($me,%m)) {
if (u isincs $chan($v1).mode) part $comchan($me,%m)
inc %m
}
}