I learn something new every day.

Ok, that was just a snippet of the post I'll fart with it. I thought I inserted it where you said in the OnPenDown section. Here is what it looks like.
function OnPenDown()
Tpierce = (Tpierce + 1)
if (string.find(operationName, _("Outside Offset") )) then
post.TextDirect("o549 \n")
post.Text (" X")
post.Number (Sline1,"0.0000")
post.Text(" Y")
post.Number (Sline2,"0.0000")
post.Eol()
end
if(dist >= (refdistance)) then
dist = 0
post.ModalText(" G28.1 Z")
post.Number(3 * scale, "0.00")
post.Eol()
post.ModalText(" G92 Z0.0\n")
post.ModalText (" G00")
post.ModalNumber(" Z", switchoffset, "0.0000")
post.Eol()
post.ModalText(" G92 Z0.0\n")
post.CancelModalNumbers()
end
post.ModalText (" G00")
post.ModalNumber (" Z", pierceHeight * scale, "0.0000")
post.Eol()
if (preheat > 0) then
post.Text ("\n G04 P")
post.Number (preheat,"0.###")
post.Eol()
end
post.Text ("\n M03\n")
if (pierceDelay > 0) then
post.Text (" G04 P")
post.Number (pierceDelay,"0.###")
post.Eol()
end
end
GL