You have double posted - in the other thread there is some useful advice please read it.
If you use Ruby code to reset the formula to be a fixed number how can you expect it to be a formula again later on?
You must change the attributes that the formula is using to effect a change that is not permanent! The formula cannot be changed in anyway without changing how the DC works.
There are also other DC Ruby tools to scale objects too...
If 'lenx' is '=value' can't you change the contents of the 'value' attribute itself [or if that is itself set in some complex way then change the attribute[s] that it is using etc...], which on a redraw then changes the contents of the DC.