Execute a script via a button

Do you mean to play an action, or run a JSX script? Yes, either can be done.

I have a UXP plugin that plays actions and there have been no issues at all with that.

You can also play JSX extendscript through UXP. I don’t use this in my plugins but I did do some testing. It works fine but for some reason runs at about 1/2 the speed that my JSX extendscripts run when ran natively, not through UXP.

Here is the documentation for playing actions.

https://www.adobe.io/photoshop/uxp/ps_reference/classes/action/
https://www.adobe.io/photoshop/uxp/ps_reference/classes/actionset/