I have a system which takes a library block or model reference block, copies it, modifies it, and places it in a new folder which is guaranteed to be higher on the MATLAB path. This manipulation of the path search process allows for augmentation of a library without actually affecting the original file, which is key for file integrity and file touch detection algorithms.
After the simulation is run these temporary copies are deleted and the folder they were in is removed from the path again. This works fine as long as for every preparation a corresponding clean up is run.
It would be nice to be able to add a temporary virtual path on top of the MATLAB path for a given run of a model. This is similar to the slprj folders auto generated by Simulink but instead of .c source files and object files simulink model files are used.