How to modify the value of a local variable in Workflow 8 using JavaScript in Run Script?

I would like to know how to modify the value of a local variable in PlanetPress Workflow 8 using Run Script plug-in if I use JavaScript as the language? I wanted to call the local variable and get its value and place it inside a JavaScript declared variable, modify it and place the modified value back to the local variable that Workflow can use as file name for an output file. I tried right-click in the Script Editor window and choose my desired local variable. Then it just gives me a syntax error.

It would look something like this:

var myvarStr = Watch.GetVariable("myvar");
myvarStr = "hello world";
Watch.SetVariable("myvar", myvarStr);

Note that pressing F1 in the Run Script action takes you to the online help for that task. The third paragraph of that online help page includes a link (Using Scripts) leading to a detailed explanation of how you can use/modify several types of dynamic values for your process, including the use of the Watch.SetVariable() method.