Listers with specific title to front on activate

var closid = activateListerData.lister;
var closidx = activateListerData.active;
if (closidx==true){
  var titx=closid.title;
  if (titx=="LOCKED"){
    for(var eListers = new Enumerator(DOpus.listers); !eListers.atEnd(); eListers.moveNext())
    {
    var lister = eListers.item();
      if (String(lister) != String(closid))
      {
      cmd.SetSourceTab(lister.activetab);
        if (lister.title == "LOCKED")
        {
        cmd.RunCommand("Set LISTERCMD=ToFront");
        }
      }
    }
  }
}

This is fragment of code I put on activate lister. I want all listers called "LOCKED" bring to front after I activate lister that is called "LOCKED". But run command activates script too and this gives endless loop. Any way to prevent this? Something like "NOSCRIPT" option?

Or maybe there is a way to prevent onActivateLister to be called if time before previous activation of script was too short? Some global variable that can be set and then I can check if time difference is smaller than, for example, 1 second? It will be workaround but without "NOSCRIPT" there is no other way as I think. Unfortunatelly, I don't know how to do that.

Update: I made workaround for this based on other script but "NOSCRIPT" option will be nice here.

Update 2: Now I see that is possible to edit posts in "Script & Plugin Development" too. Sorry for triple post.

12.3.1 has a NOSCRIPT option for Set LISTERCMD=ToFront.

Thank you.