Hi Sander,
Unfortunately, scripts are modal by nature in PixInsight. For a number of critical reasons, script execution has to block the Core application. This means that you can't run a script and continue interacting with the application as if nothing were happening. This level of integration, which is naturally achieved with PCL-based modules, is simply impossible with scripts right now (and will probably continue that way in the foreseeable future). This is the reason why you can only create dialogs in PJSR (the Dialog object and descendants), not generic top-level windows.
But don't let this limitation stop you. JavaScript scripts are extremely powerful and in many cases are the best way to implement specific tasks that aren't available as standard tools, such as batch procedures. And you can do a lot of sophisticated things by just invoking processEvents(), as Nikolay and Georg have demonstrated with their respective Animation and CanonBandingReduction scripts.