From nanotee/nvim-lua-guide, the section on Managing vim internal variables shows various API calls, including
In practice, setting a global variable looks like
vim.api.nvim_set_var('some#var', 'value')
You can also use the meta-accessors, such as vim.g:
vim.g['some#var'] = 'value'
The method with vmd.cmd can work, although using the more structured API shown above is advised.
Note that in vim.cmd("let some#option = option") the right-hand side of the assignment operator is an expression. This means the plain token option would be evaluated as an identifier.
Depending on what you are trying to do, you may need to add additional quotes to create a string.
vim.cmd("let some#var = 'value'")