another strategy could be to use the +R mode

//mode $me +R

if the irc network supports +R mode, then your bot will not see any CTCP or NOTICE from a nick that's not identified to nickserv. If the users communicate with the bot via /notice, then the bot wouldn't need to do anything since it wouldn't see the non-identified chatter. Some networks also have a +M mode that can be given to a channel, which would prevent someone from typing text into the channel window unless they're identified.