Code:
on *:TEXT:*:#:{
  if ( [color:green]stuff here[/color] ) {
    window -g2 #
  }
}