It works quite nicely now, I did small changes to code:
Now there are two client tags DisableOverlays boolean and OverlayDisabledUntilTS DateTime
DisableOverlays has Expression:
try(
now() < {[Client]OverlayDisabledUntilTS}
,0)
Tag Event Value Changed:
system.tag.setOverlaysEnabled(not bool(currentValue.value))
And when I load any window, I use code:
system.tag.write('[Client]OverlayDisabledUntilTS', system.date.addMillis(system.date.now(), 1500))
This adds the support of changing the estimated load time of each window, based on their complexity. To make it bit nicer, I would also wrap the tag write call to some project library, so the complexity is hidden in normal use.
Thanks @pturmel and @Paullys50!