There were two syntax errors

Code:
Mbutton:: 
IfWinActive, ahk_id %WowWinId1% 
ControlClick, Pos, ahk_id %WowWinId2%, , RIGHT 
IfWinActive, ahk_id %WowWinId2% 
ControlClick, Pos, ahk_id %WowWinId1%, , RIGHT 
RETURN
#1 the {} brackets are the wrong group symbol for the body. The return line handles this.

#2 there is a BLANK optional argument before the right click.