Revit dimension replaced with new one when reselect and re-run script

Have a look at the following post because what you are experiencing does seem to be element binding- Element Binding in Revit