Hi,
I do not code so much with AutoLISP these days, but I have reproduced the process executed by the
ATTSYNC command with .NET.
Pseudo code:
Get the block definition
Get all the attribute definitons in the block definition
Foreach block reference inserted in the drawing
Store the attributes values in an assoc list (tag . value)
Erase the all attribute references
Foreach attribute definition
Add a new attribute reference to the block reference attribute collection
Set the attribute reference properties according to the attribute definition ones
Set the attribute reference geometry according to the block reference one (insertion point, scale, rotation)
Set the attribute reference value according to the stored ones