Yes, but only if the code consists of just $identifiers, text, and/or %variables to add to the end of that message. If you want other /commands to be performed then you'd have to use something like the example in my first post:
Code:
msg $chan something
if ($my_rand(1,33) == 1) {
some_other_command extra things
}


If you still don't get what I mean check the helpfile under $iif and If-then-else - that'll explain how they work better than I can.