What's the correct way to prevent a dialog from opening more than once?

I have an ExtendScript, which has this

/*

<javascriptresource>

<name>My Script</name>

<category>scriptexport</category>

<menu>export</menu>

<about>Some description</about>

<eventid>Some ID</eventid>

</javascriptresource>

*/

When I go to File > Export > MyScript, it opens a window/dialog, which allows the user to provide some inputs.

Now, I just realise that, if I click on File > Export > MyScript multiple times, it will keep opening new windows. Is it possible to prevent this, i.e. at most 1 window should be opened at a time? It’s probably possible but is there an easy way to do it? If not, what do you recommend?