Silo, you might want to include a check to see if the R mode has already been set:
if (R isincs $chanmodes) $iif($+(+,$v1) !isincs $chan(#).mode,mode # $v1)