Yes, call
local inst=mc.mcGetInstance(); -- Omit this if you already have done this
mc.mcCntlSetLastError( inst, "Your error message here" );
That will display a message in the Mach4 status/error line at the bottom of the window, and also in the "History".
Or you can use:
mc.mcCntlLog(inst, "Your error message");
Which will add an entry to the Mach4 log (view it from the Diagnostics menu, select "Logger").
Disclaimer: I am not at a PC with the Mach API docs. In the plug-in API, there are two additional parameters in the mcCntlLog() call, the file name and line number. I don't know if they exist in the Lua version, or if they are optional. I *think* you can pass NULL and zero for these if you don't want or need them, but I'm not sure.
mc.mcCntlLog( inst, "Your error message", NULL, 0 );
Bob