I have 2 set of codes to make this work. One in alias and one in remote. Is it possible to replace both with one in remote?

alias: randomnick {
if ( $me isop #manila ) { set %op.random.channel.nick $rand($nick(#manila,0),1) | whois $nick(#manila,%op.random.channel.nick) }
}
remote: on *:{
if ( %op.random == off ) || ( %op.random == $null ) { return }}