Script UI palette
InDesign (like Photoshop) runs every script in a new scripting engine. When the script is done executing, the scripting engine goes away. So if you're showing a palette, it goes away too (very quickly). If you're showing a modal dialog, the script hasn't been completed, and the dialog remains.
To show a palette, you have to run it from a persistent, named scripting engine. You create one of those using the #targetengine directive in your script. Even then, to run it from the ESTK, the engine must already exist. You can place a small script in a folder named "startup scripts" underneath the Scripts folder for InDesign. When InDesign starts, it looks for all jsx files contained in folders named "startup scripts" underneath "Scripts" (and it's a hierarchical search - it will look downline in all folders) and runs them, creating persistent scripting engines for all those that have the targetengine directive.
In PHOTOSHOP, you can't create a persistent engine yourself. Meanwhile, PHOTOSHOP does have 1 persistent engine for BridgeTalk, so you can send a BridgeTalk message to PHOTOSHOP to request it to open a palette.
InDesign does have an engine named "session", but I don't recommend using it though. If you consider what could happen if a user had 10 scripts written for the session engine, you could run into unexpected trouble. The "session" engine has (just like any other engine) a single global namespace. If two scripts get loaded into that engine which have identically named functions, running the second script will replace the first script's version of the function.
The safest way to go is to always create your own engine.