Sorry I don't have a lot of time, I am meeting some friends for pizza and will try to follow this up, but hopefully I can point you in the right direction.
You'll get a lot of help from the API documentation and the samples in the LuaExamples folder, also dig through the Mach4Toolbox subsection of this forum and look for a document called : "McLua mc Scripting Reference SpacedOut.pdf" it's really helpful.
This is how you put in a remark:
--This is the remark. It works on only one line, and is preceded by two dash marks.
Message Boxes are written as follows:
wx.wxMessagebox("Your message goes here.");
Sleeping, where number of milliseconds to sleep goes between parenthesis.
wx.wxMilliSleep()
Activating signals is a little harder, first the controller instance must be captured:
local inst = mc.mcGetInstance()
and then for some reason the signal must be ported through a handler before it is used.
this is the mcSignalGetHandle() command, see also mcSignalMap
the signals you are looking for are OSIG and ISIG, look in the API manual (C:\MachFolder\Docs\) under "Mach Signals" where you will also find the Get and Set commands
functions are called like this:
function NameOfFunction (arguments)
-- comment so I can fill the function and show that bracket notation is not necessary for multi-line function
end