Probably an idiosyncracy in the way Windows handles external libraries.
If it's just the constant that's bothering it, change the enumerated constants to their numerical value. This has been reported before to work.
As per my idea idMeasurementUnits is not a enum its a class which have some properties.
And this class is defined in InDesign VB Script DOM.
let me know If I am missing something else.
It is an enum:
The unit of measurement.
The value you're looking for is
Now script is working fine....