use
? as the target in either an on TEXT or on ACTION event:
examples:
The following will trigger when somebody queries you with the msg "text"
on !*:TEXT:help:?:msg $nick Hello, $nick $+ . How may I help you?
The following will trigger when somebody queries you with the action "going crazy!"
on !*:ACTION:going crazy!:?:msg $nick What's wrong?
Note: It is possible to trigger these events yourself by querying yourself (why would you? I don't know) because the message/action will be both sent and received by you. (this is why you see messages sent to yourself twice if you've ever tried it). Therefore, if you expect that this, for whatever reason, will be an issue, you can prefix the event with an ! like I demonstrated above.