Using /var and while loops, instead of /set and goto, is generally better
alias listops {
echo 4 * Listing Ops on #
var %i = 1
while ($nick(#,%i,o)) {
echo 3 # * $ifmatch is an Op!
inc %i
}
var %i = 1
while ($nick(#,%i,h)) {
echo 3 # * $ifmatch is an HOp!
inc %i
}
echo 4 * End of Ops list
}
Some networks may allow the use of "/notice %#channel message", similar to "/notice @#channel message", to send a notice to all ops or hops, but I don't really know so I won't use that. You could try it and see if it works though

/hopnotice <message>
alias hopnotice {
var %i = 1
while ($nick(#,%i,h)) {
.notice $ifmatch $$1-
inc %i
}
echo -at -> $+(HOps:,#,:) $1-
}