You can use the consoleLib.cancelArrayDelete() system function to terminate the delete operation in progress during the execution of a BEFORE_DELETE openUI event code block. If you call this function outside the scope of an openUI statement at runtime, nothing happens.
consoleLib.cancelArrayDelete( )