If you would try to run this code outside of ArcGIS Desktop application (e.g., in a Python shell), you'd get the following error:
Traceback (most recent call last):
Python Shell, prompt 2, line 1
RuntimeError: Not running in a desktop application.
You need to run this code in ArcGIS Desktop (for instance, ArcMap or ArcCatalog). In other words, you cannot make your arbitrary Python script running outside of ArcGIS Desktop application open up a GP tool dialog. The logic for this would work only when the Python code is executed either within the Python add-in in ArcGIS Desktop application or when you run this code in a Python script that is a script tool or within the Python window:
This will open up the tool dialog window. Keep in mind that you need to specify the tool
Name, not its
Help page for GPToolDialog.