Actually this would behave more like /amsg:
anotice {
var %i = 1,%t = $chan(0)
if (!%t) return
while (%i <= %t) {
var %chans = $addtok(%chans,$chan(%i),44)
inc %i
}
notice %chans $$1-
}
It simply sends one multiple target notice instead of a whole bunch of individual ones. Many networks would not take kindly to what could be dozens of notices being sent within a second. At the very least each notice would have a slight delay, at the worst you could be booted off the server.
I'm not entirely certain that all networks will accept multiple targets for notices, but I don't know of any raw 005 token which signifies if they do (or if there's a limit to how many targets they accept).