You may need to save the script as an app rather than as a compiled script.
The issue is that if your script includes any user interaction (e.g. the 'display dialog'), then it has to run in the GUI.
As a .scpt file, the script is technically a document, and that document needs an application, so just opening it normally will launch a script editor.
Conversely, saving it as an app will allow the app to run standalone, so you can just use the standard
open command:
<pre class=command>open /Users/path/to/script.app</pre>
You'll still be able to open and edit the script with Script Editor, but the .app has the ability to stand on its own.