Use this then,

Im not sure why its not picking up the @ part on the on text event

Code:
On *:text:+i:#: {
If ($nick isop #) && ($nick == $me) {
Mode # +i
Msg # $nick set "invite only" on #
}

}