I'm not sure where this is coming from. Is this twitch? If this line is contained in $1- where each number is the Nth "word", it looks like M/F is the 5th "word", so if that's true, it would be:
/cline -m $iif($5 == M,2,4) #Name_of_the_channel $mid($gettok($1,1,33),2)
This assumes the $5 5th word is either M or F, and assumes blue is 2 and red is 4. If the word is something else besides M or F it takes 4 too.
The last part needs to parse the $1 first word to take everything to the left of the "!" beginning with the 2nd character.