I encountered two different "quote pass" server notices from Undernet:
*** Ident broken or disabled, to continue to connect you must type quote pass ...
*** No response to ident check, to continue to connect you must type /quote pass ...
The problem then comes from (1) counting off which word is your code, i.e. the $14 and $15 in the posts above, and (2) identifying the server notice string. I propose the following solution:
on 1:snotice:*quote pass*:quote pass $right($1-,5)
$right($1-,5) simply identifies the last 5 characters in the server notice line ($1-), so the number of words becomes irrelevant.