You would only need to iterate through the objects in each Block Definition and all Inserts (References) are updated following modification of the Definition.
Hence, create a SelectionSet of Inserts, iterate through the SelectionSet and, for each Insert, check its name against a list of block definitions already processed, if it doesn't appear in the list, process the block definition (as I have demonstrated above) and add the name of the block to the list; otherwise, move onto the next block in the Selection.
Lee