Not sure on the ByVar stuff.....
But as far as setting a variable:
There are a couple of ways, in your plugin, in the Initialize section of the code that runs only once, you can set it there:
The other options are in the OnSkinStart line of the exectbl, or saving it to the skin or RR.ini's and it will be set when RR loads.
tmp = RRSDK.GetInfo ("=MyVar$)"
If tmp = "" then
RRSDK.Execute("SaveToIni;YourVar;DateInVar") ' <--- saves for later recall on next load if you want it to be remembered