The following code will redefine all blocks in the drawing for which a drawing file of the same name is found either within a specific directory, or within an AutoCAD Support File Search Path (SFSP):
Alter the value of the dir variable to source blocks from a specific directory, or set this variable to nil (the current value) to source blocks from the AutoCAD SFSP or working directory.