$iif($nick($chan,$me,q) || $nick($chan,$me,~),SOP)

Note that you don't need a , at the end of an $iif when you only are showing the $true action and $false is left off.