Hello!
I've been looking for this feature for some time now, seems it had been impl'd in one of the more recent versions (test with v2716):
You can provide parameters to custom M code Lua scripts. Please refer to example LuaExamples/UseVarsFromMcodeLine/M162.mcs.
local pFlag = mc.mcCntlGetLocalVarFlag(inst, hParam, mc.SV_P)
... checks if parameter P is available ...
local pVal = mc.mcCntlGetLocalVar(inst, hParam, mc.SV_P)
... while this line retrieves the value as double
mc.SV_P may be replaced by any character between SV_A and SV_Z.
Small example M162 script attached, which writes values of all present parameters to log.