Run ScriptUI From UXP Panel

Just because I was curious, I just tested and it works for me in Photoshop 23.0.0 with API 2 using the method the Davide Barranca posted about.

However, you don’t have to read too far between the lines to understand that this is something that really shouldn’t be done, especially for long term use or if it is something that you distribute.