Within the code, could i get to strip out the xref name and just the block name?
(and (setq a (cdr (assoc 2 (entget b)))) (setq r (strcat (stripxrefprefix a) "\\\P" r)))
I thought initially it was the "|" character that was supposed to find and remove.
In the snapshot above, if it could remove the "xUtility" portion, i think it would be fine!
Just a thought, i have not tried this yet, but it should return block names for dynamic blocks too?