Thanks for that reference. I'm not trying to pass a parameter, just get normal M3 functionality with the addition of a popup window telling me what RPM to set.
After a couple hours of messing with this, I finally got it. Here's my M3 script. This seems so obvious now... learning a new programming language just takes a little patience I suppose.
function m3()
inst = mc.mcGetInstance()
commandrpm = mc.mcSpindleGetCommandRPM(inst)
mc.mcCntlSetLastError(inst, 'SpindleClockwise')
mc.mcSpindleSetDirection(inst, 1)
wx.wxMessageBox("Set spindle RPM to " .. tostring(commandrpm) .. "\nThen press Cycle Start to continue")
mc.mcCntlToolChangeManual(inst, true)
end
if (mc.mcInEditor() == 1) then
m3()
end