You can use $target to check to whom the notice was sent.
For op notice check the presence of @ in $target
For chan notice check for #
Some networks allow voice notices as well in which case you would look for +
And as with other events you can prefix the event with ^ and halt the default output.