Is it possible to permanently store a variables inside the guest's VMX file? (This used to be possible with VMCOM)
It's possible with VI SDK. The VirtualMachine object has a method called reconfigVM_Task() (http://pubs.vmware.com/vi-sdk/visdk250/ReferenceGuide/vim.VirtualMachine.html#reconfigure). The parameter is VirtualMachineConfigSpec. Just assign the key/value pair into the extraConfig property of the parameter. Upon the success of invocation, the key/values will be saved to the .vmx file.
Please make sure you don't have a conflicting key with any existing one. For that purpose, you could use Java naming convention like com.<companyname>.** for your keys.
Steve JIN, VMware Engineering