The G code interpreter will take M03, m03, M3, or m3 and turn them all into m3. So when looking for a macro, it will use m3. Much simpler than looking for all 4 variations.
Using the constants is a very good idea. Because if we change the value of the constant, it will not require you to change your code.
The return code is simply discarded and garbage collected if it is not used. However, I strongly suggest checking for error codes! Not only is it a good programming practice, it could have bearing on whether or not you loose a finger or not! Yikes! In truth, it is not necessary all of the time. But if you get into the habit, it is going to pay dividends in the future for sure.
All of the API functions have their possible return codes documented and I'd say that the majority are correct. In the event that we messed up, I prefer to test for inverse success. e.g.
if (mc.mcSpindleSetDirection(inst, mc.MC_SPINDLE_FWD) ~= mc.MERROR_NOERROR) then
--handle any failure!
end
Steve