Both LUA and moonscript use ' -- ' as single line comment so maybe a way to allow the use of moonscript would be to use a special tag like "--[moonscript]".
- If the first line of the script as the exact tag "--[moonscript]" then all the code is in moonscript,
- otherwise it is in LUA
--[moonscript]
x = 10
if something
local x
x = 12
print x -- prints 10