I think perhaps the line:
optionsTable.insertBefore( row, optionsTable.children );
should perhaps be:
optionsTable.insertBefore( row, optionsTable.rows );
This is just looking at the TableSection interface. I did no testing to see if this theory is correct. (but I'll put it on my to do list to see if that solves the issue)
var optionsTable = document.getElementById( 'mw-htmlform-description' ).tBodies;
so optionsTable is a TBODY, which is of type HTMLTableSectionElement (http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-67417573) and not of type HTMLCollection. So rows (which is a HTMLCollection) should indeed be used.
(In reply to comment #9)
My Firefox does have an optionsTable.children. Is this non-standard behaviour?
Apparently; according to the MDC .children was introduced in FF 3.5. There is no mention of whether or not this is a non-standard extension, though.
optionsTable.childNodes has worked since like the beginning of (DOM) time and does the same, except that it includes TextNodes while .children doesn't.