You are editing the attribute definition within the block definition, not the attribute within the insert.
You would need to use something like this:
(vlax-for obj (vla-get-ModelSpace
(vla-get-ActiveDocument (vlax-get-acad-object)))
(if (and (eq "AcDbBlockReference" (vla-get-ObjectName obj))
(eq :vlax-true (vla-get-hasAttributes obj)))
(foreach att (vlax-invoke obj 'GetAttributes)
(vla-put-TextString att "test"))))
Of course, this is only working on the ActiveDocument, and only in ModelSpace. If you were using ODBX, you would use the ObjectDBX Document, and perhaps iterate through all the layouts.
Lee