This is a reasonalbe start.
You can also do javascript on object, and just do:
foo = object.value;
What could be simpler?
Now, you can do File I/O but you should NOT for loadrunner. If you have 1000 Vusers - do you really want each of them opening and writing to the same file at the same time?
If you must write the value:
LR.log(value)- then you can get it from controller log
use VTS - fully supported in 11.52