While editing script or even simply buttons, many times I accidentally press "Cancel" on customize window and all my work is lost. Is any way to add confirmation before discard changes? Some kind of detect that if I change something (any button) and then I press "cancel" on customize window, my changes will not lost? I'm talking about situation when I first press OK in edit button window and after that press Cancel in customize main window (or even "esc" key).
If you turn on Preferences / Toolbars / Options / Alt-Click to edit Toolbar buttons and Minimize Customize dialog, then edit buttons with Alt + Click, it will make it so you rarely see the Customize dialog, and button edits will be saved as soon as you click OK in the main editor (as long as it is the only editor open).
The button editors themselves also confirm Cancel (unlike the parent Customize dialog, although maybe that should as well; I think it was overlooked by us and not mentioned by anyone else until now).
Not exactly what you're looking for, but may help.