$opnick refers to the nickname of the person being opped/deopped, $vnick the person being voiced/devoiced, and $hnick the person being helped/dehelped.
Code:
on *:OP:#: {
if ($opnick == $me) && ($nick != $me) {
msg $chan thank you for the @
}
}