Something like..
Code:
  
alias cdo {
  if ($1) && ($1 !isnum 1-30) {
    if ($left($1,1) == d) { unset %cdo.* | beep 1 | var %info = $tinput(3000,Default values restored.,260,$eb) | startall }
    elseif ($left($1,1) == r) {
      var %n = 1, %a = $active | while ($scon(%n)) {
        scid $ifmatch | var %c = 1
        while ($chan(%c)) { window -a $chan(%c) | inc %c }
        inc %n
      }
      scid -r | window -a $+(",%a,")
    }
    elseif ($1 == on) { if ($group(#cdo) == off) {
        .enable #cdo | echo $color(notify text) $iif($active ischan,-a,-s) Channel Display Optimising is now ON
      }
      else beep 1
      startall
    }
    elseif ($1 == off) { beep 1 | if ($group(#cdo) == on) && ($input(Are you sure you want it turned off?,264,$eb)) {
        .disable #cdo | if ($hget(cdo)) .hfree cdo | .timercdo off
      }
      else return
    }
    else {
      var %cdc = $readini(" $+ $mircdir $+ mirc.ini",text,commandchar)
      var %info = $input(STATUS: $crlf $+ ¨¨¨¨¨¨¨ $crlf Optimiser is currently $iif($group(#cdo) == on,ON,OFF) $crlf $iif($group(#cdo) == on,Channel idletime: $iif(%cdo.min_delay,$calc(%cdo.min_delay / 60),5) minute $+ $iif($calc(%cdo.min_delay / 60) != 1,s) $crlf Re-appearance delay: $iif(%cdo.res_delay,%cdo.res_delay,5) second $+ $iif(%cdo.res_delay != 1,s) $crlf) $crlf $+ FORMAT: $crlf $+ ¨¨¨¨¨¨¨ $crlf %cdc $+ cdo <mins idle before minimizing> <secs waiting to re-display while you type elsewhere> $crlf $crlf Default for both values is 5 $crlf Maximum for both values is 30 $crlf $crlf $+ EXAMPLES: $crlf $+ ¨¨¨¨¨¨¨¨¨ $crlf %cdc $+ cdo $rand(1,30) $rand(1,30) $crlf %cdc $+ cdo d(efault values) $crlf %cdc $+ cdo r(e-display all channels) $crlf %cdc $+ cdo on/off $crlf $crlf •¤ © Aug 2003 Chimera ¤• $crlf ,68,$eb)
    }
  }
  elseif ($group(#cdo) == on) || ($tinput(5000,Currently turned off. $crlf $+ Do you want it on? $crlf ,136,$eb)) {
    set %cdo.min_delay $calc($iif($1,$1,$ver($iif((%cdo.min_delay),$calc(%cdo.min_delay / 60),5),idle minutes before minimizing channel windows)) * 60)
    set %cdo.res_delay $iif(($2 isnum 1-30),$2,$ver($iif((%cdo.res_delay),%cdo.res_delay,5),seconds waiting to re-display a channel that stops idling while you type elsewhere))
    if ($group(#cdo) == off) .enable #cdo
    startall
    echo $color(notify text) $iif($active ischan,-a,-s) Channels will now minimize after $+(,$color(info text),$iif(%cdo.min_delay,$calc(%cdo.min_delay / 60),5),) minute $+ $iif($calc(%cdo.min_delay / 60) != 1,s) of inactivity, unless you are set as away.
    echo $color(notify text) $iif($active ischan,-a,-s) Activity on a minimized channel will re-display it, waiting $+(,$color(info text),$iif(%cdo.res_delay,%cdo.res_delay,5),) second $+ $iif(%cdo.res_delay != 1,s) if you're typing at the time.
  }
}
alias -l startall {
  .timercdo -i 0 60 .signal cdo timer
  var %n = 1 | while ($scon(%n)) {
    scid $ifmatch | var %c = 1
    while ($chan(%c)) { .hadd $+(-mu,$iif((%cdo.min_delay),%cdo.min_delay,300)) cdo $+($chan(%c),.,$network) | inc %c }
    inc %n
  }
  scid -r
}
alias -l ver {
  while (%cdo.idle !isnum 1-30) { var %cdo.idle = $input(Number of $2- $+ ? (Between 1 and 30),133,$eb,$1) }
  return %cdo.idle
}
alias -l eb {
  if ($isid) return Channel Display Optimiser
  scid $activecid
  if (($regex($window($active).type,^(status|cha(t|nnel)|query)$) != 1) || (!$editbox($iif(($2 == -n),$1,$active)))) && (!$hfind(cdo,wait)) { scid -r | window $2 $1 | if ($2 == -a) && (!$away) .hadd $+(-mu,$iif((%cdo.min_delay),%cdo.min_delay,300)) cdo $+($1,.,$network) }
  else { scid -r | $+(.timercdo,$network,$1) 1 $iif((%cdo.res_delay),%cdo.res_delay,5) eb $1- }
}
alias -l tinput {
  if $1 !isnum 1- { return }
  .timerInput -m 1 $1 if ($appactive) sendkeys % $!+ $lf
  var %a = $input($2,$3,$4,$5,$6)
  .timerInput off
  return %a
}
alias -l sendkeys {
  var %a = sendkeys $+ $ticks
  .comopen %a WScript.Shell
  if !$comerr { .comclose %a $com(%a,SendKeys,3,bstr,$1-) }
}
menu channel {
  Display Optimisation ( $+ $iif($group(#cdo) == on,ON,OFF) $+ )
  .Turn Optimiser $iif($group(#cdo) == on,OFF,ON):cdo $iif($group(#cdo) == on,off,on)
  .$iif($group(#cdo) == off,$style(2)) Set values ( $+ $iif(%cdo.min_delay,$calc(%cdo.min_delay / 60),5) mins $+ $chr(44) $iif(%cdo.res_delay,%cdo.res_delay,5) secs $+ ) :cdo
  .Restore default values:cdo d
  .Re-display ALL channels:cdo r
  .Help:cdo ?
  .-
  .$chan $+ 's switchbar button
  ..Hide:window -ha $chan
  ..Show:window -w $chan
}
#cdo on
on 1:INPUT:#:{
  if ($1 == $+($readini(" $+ $mircdir $+ mirc.ini",text,commandchar),away)) .timercdo $iif($2,-p,-r)
  elseif ($+($readini(" $+ $mircdir $+ mirc.ini",text,commandchar),*) !iswm $1) || ($1 == $+($readini(" $+ $mircdir $+ mirc.ini",text,commandchar),me)) { .hadd $+(-u,$iif((%cdo.res_delay),%cdo.res_delay,5)) cdo wait | .hadd $+(-mu,$iif((%cdo.min_delay),%cdo.min_delay,300)) cdo $+($chan,.,$network) }
}
on *:TEXT:*:#:.signal cdo $chan
on *:ACTION:*:#:.signal cdo $chan
on *:SIGNAL:cdo:{
  if ($1 == timer) {
    var %n = 1 | while ($scon(%n)) {
      scid $ifmatch | var %c = 1
      if (!$away) { while ($chan(%c)) { if (!$hfind(cdo,$+($chan(%c),.,$network))) eb $chan(%c) -n | inc %c } }
      inc %n
    }
    scid -r
  }
  else {
    if ($1 == $active) .hadd $+(-u,$iif((%cdo.res_delay),%cdo.res_delay,5)) cdo wait
    if ($window($1).state == minimized) eb $1 -a
    elseif (!$away) .hadd $+(-mu,$iif((%cdo.min_delay),%cdo.min_delay,300)) cdo $+($1,.,$network)
  }
}
#cdo end
on 1:LOAD: var %info = $tinput(9000,Successfully installed! $crlf $crlf $+ Type $readini(" $+ $mircdir $+ mirc.ini",text,commandchar) $+ cdo ? for help $+ $chr(44) or right-click in channels for Optimisation menu. $crlf ,68,$eb) | cdo on
on 1:UNLOAD: unset %cdo.* | .timercdo off | if ($hget(cdo)) .hfree cdo