Hmm, that was just a concept. I was hoping that you will test it on a larger amount of selected blocks and don't hack your computer by doing that - not best experience with this approach.
I would definitely not recommend adding just "X"...
The selection needs to be improved much better to exclude all xrefs, arraypath, better all dynamic blocks and its references, then all blocks process just once, not each reference... and so on.
(vl-load-com)
(defun c:OverkillInBlocks ( / *error* adoc lst next)
(defun *error* (errmsg)
(if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break,end"))
(princ (strcat "\nError: " errmsg)))
(vla-endundomark adoc)
(princ))
(vla-startundomark (setq adoc (vla-get-activedocument (vlax-get-acad-object))))
(vlax-for blk (vla-get-blocks adoc)
(if (and (= 0 (vlax-get blk 'islayout))
(= 0 (vlax-get blk 'isdynamicblock))
(= 0 (vlax-get blk 'isxref))
(vlax-write-enabled-p blk)
(not (wcmatch (vla-get-Name blk) "`*@*"))
)
(setq lst (cons (vla-get-Name blk) lst))))
(foreach n lst
(command "_.-BEDIT" n)
(if (not next)
(command "_.OVERKILL" "_all" "")
(command "_.-OVERKILL" "_all" "" "_Done"))
(command "_.BCLOSE")
(while (> (getvar 'CMDACTIVE) 0)
(command "_save"))
(setq next T))
(if lst (princ (strcat "\n" (itoa (length lst)) " blocks cleaned.")))
(*error* "end")
)