Vectorworks stores dimensions in WorldCoord which at this point is equal to one mm. When you used 50cm in VS it would automatically convert it into 500. Regardless of the unit settings, that is the value, always.
When showing the coordinates to the user, the value is modified based on the unit settings, but the length is always the same.
Can't this function do the same ?
http://developer.vectorworks.net/index.php/VS:Str2Num