Code:
on me:*:join:#:.timeroc 1 5 oc
alias -l oc {
  var %x = $chan(0)
  while (%x) {
    if ($me !isop $chan(%x)) {
      msg $chan(%x) message here
      part $chan(%x)
    }
    dec %x
  }
}
This code is working for me upon testing.