I made a custom window script for when ops/voiced users in a channel talk, it puts what they say in a separate window so I can track their messages.

It's a channel that's developing a game and the channel has 600+ people, so I like knowing when the developers specifically speak up.

Now, my script works, but I just need a little help.

Code:
on *:TEXT:*:#Starbound*: {
  if ($nick isop $chan) { 
    if ($nick == ModBot) { return }
    else { 
      ;;;window -k[0]ng[1] @Starbound 
      aline -pih @Starbound $timestamp <02 $+ $nick $+ > $1- 
    }
  }
  elseif ($nick isvoice $chan) { 
    ;;;window -k[0]g[1] @Starbound 
    aline -pih @Starbound $timestamp <02 $+ $nick $+ > $1- 
  }
  else return  
}


This is the script as it is, and I disabled the /window command for now. What I need is for it to only open the window if it's not open already. I figure it is a 'if @window == open' or something like that, but I don't know the code specifically to do that.

I don't want it triggering the /window command every time they talk since that's unecessary and it'll boot me out of the window itself when I am trying to read it.