What you are showing is a simple on TEXT. However, for your status check, that will only work if the user is online unless you're storing that somewhere. Without knowing how you are planning on handling that for offline users, I can't put anything to handle status for offline nicks. This will say the nick is offline regardless of their op status. Maybe that's okay for what you need?
on *:text:!*:#: {
var %admin = $remove($1,!)
if ($nick($chan,%admin,vr) || $nick($chan,%admin $+ |AFK,vr)) { return }
if (%admin ison $chan) {
if (!$2) { msg $chan You did not include a message to send. | return }
msg %admin $2-
msg $chan %admin was notified!
}
elseif (%admin $+ |AFK ison $chan) { msg $chan %admin is AFK }
else { msg $chan %admin is offline }
}
Be aware that the script has no idea if someone is typing !nick or !command. For example, if someone tries to type !help, the script will respond that help is offline. If you *do* store op status somewhere, then it won't respond to invalid nicks.
Also, this doesn't check for duplicate nicks. For example, if one nick is MyNick and another user's nick is MyNick|AFK. It won't verify to see which nick is the correct one. Normally, that shouldn't be a problem, but it's something to be aware of if you have people who like to be idiots in your channel.