I’m not where I can write code for an example but this is something that I do regularly.
Step 1: I have a simple drawing with all replacement blocks defined in it
Step 2: I insert said drawing
Step 3: Entmod assoc 2 with the new block name on each insert.
Step 4: Purge said drawing
in that way you update the block definition don't replace a block with a different block, isn't it?
Let me explain in a little more detail now that I am not typing on my phone.
Suppose I have a block in my drawing (not a dynamic block) called "block1" and i want to replace it with a block called "block2" and want to keep the exact reference points. The first thing you need to do is get the block defined in the drawing, but you also do not want to redefine "block1" because you want to use it elsewhere in the drawing or you don't want to change all of them.
This can be accomplished by simply inserting the block and then deleting it.
Now that the block definition is in the block table, you can create your selection set of inserts and simply update the block name like so:
(DEFUN C:CHGBLK
( / ss ssl new_value index e as
) (prompt"\nReplacement block name (block must exist in drawing): ") )
)
Of course this isn't the most concise or most elegant way of doing this, but it does work and I've used this tool for perhaps 20 years to do just what you are wanting to do.