Without testing it, I think it should be:

Code:
alias aop { 
  if ($active ischan) { 
    msg chanserv aop $active add $$2 
  }
  else {
    msg chanserv aop $1 add $$2 
  }
}