OK, if we ignore the code you posted previously, and take what you said here, then things get clearer and simpler. However, I still have to make thing absolutely clear on what you want:
You insert a block from file, say, "MyBlock1.dwg" with Insert command, into say, current drawing in AutoCAD. The net result of that is:
1. A block definition named as "MyBlock1" is created in the drawing;
2. A block reference to this block definition is created in current space (model, or paper), this block reference ALSO has name "MyBlock1".
3. Now you want to run a piece of code that change the block name from "MyBlock1" to, say, "MyBlock2".
Now it is not very clear on your intention: rename the block definition, or block reference.
1. Rename block definition. In this case, once a block definition is renamed (of course you cannot use a new name that has already exists in block table), all block references to this definition (0 or more) will automatically has the new block name and remain as references to this definition. If this is what you want to do, then the code would be very simple:
Dim blk As AcadBlock
For Each blk in ThisDrawing.Blocks
If UCase(blk.Name)="[WHATEVER]" Then
blk.Name = "[NEW_NAME]" '''' As long as the new name is not duplicated
Exit For
End If
Next
After this code, if there are block references of this block definition in drawing, they will automatically get new block name. That is, changing block definition's name would change the names of all block references (to this definition).
2. Rename block reference. Theoretically, block reference name is is definition's name and should be "Read-only". However, in AutoCAD COM API, AcadBlockReference's "Name" property is used to track which block definition it is referenced to, thus it is changeable, meaning if the name is changed (to another existing block definition's name), you literally change the block reference to point to a DIFFERENT block definition. I suspect this is not what you are after.