After copying the kb_knowledge Delete button and clicking on the copy, it does nothing and generates the error "Uncaught TypeError: Cannot read property 'GlideModal' of null".
This is expected behavior because the UI action is run in strict mode, which causes the runtime issue. Basically, when running in strict mode you are not allowed to access any DOM elements. In particular, this includes the use of window.
Many of the base system scripts are allowed to run in non-strict mode, but by copying the existing UI action you are forced into strict mode.
There are several ways to address this issue:
var dialogClass = (typeof GlideModal !== 'undefined') ? GlideModal : GlideDialogWindow;