MES - End Activity Custom Button Opening Twice. Wizziwig'r seeking brilliant programmer. Thanks for any help!

I posted an issue here. Any help is greatly appreciated. I deleted it, added it again in various ways.
I try to configure the application using the wizards. My programming skills are a bit sad. It tries to open twice. First executes correctly, then loops again.

Continuing the discussion from How to change the Process Menu Item in End Labor Activity from MES Kinetic: