Code:
 on *:op:#:$iif($opnick == $me,.mode $chan -o $me) 


Please note that as written, you will not be able to maintain full ops status in any channel. If this is for one specific channel, change # to the channel name or names separated by commas