The example given is the help file is what you're looking for, the on ctcpreply version
If you need more explanation about it, I can give you a code example on how to use it, but I think it's all you need.
The on CTCPREPLY event triggers when a user sends a standard ctcp reply to a ctcp that you initiated.
Format: on <level>:CTCPREPLY:<matchtext>:<commands>
Example: on 1:CTCPREPLY:VERSION*:/echo $nick is using IRC client: $1-"