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