I think you should make sure the $1 is entered with the user prefixes, not something else. The $1 and $2 should be made with double $$ to ensure that the message is supplied before the snippet triggers:
alias oneway {
var %i 1, %rank $iif($regex($$1,/([ $+ $prefix $+ ])/),$regml(1))
while $nick(#,%i,%rank) {
.notice $v1 [ $+ viewable only by channel rank %rank] $$2-
inc %i
}
echo -ta $me oneway message for all %rank - $$2-
}
I know it's just an alias for your own use, but an alias can be made to work with an event. If triggered from an event, some people do mistype or tamper with a snippet.