Element.replace fails to replace a <form> element with another <form> element. I only observed this in Firefox. There are no errors, but the new form tag is missing. It looks like Firefox spots a nested form situation and neutralizes the inner <form> tag. I am attaching the simple test I was running. Note that $('bar') returns null.
I was able to fix this by changing prototype.js:1182 (version 1.5.0) from:
range.selectNodeContents(element);
to:
range.selectNodeContents(element.parentNode);
My test page as well as my more complex application then both worked in both FF2 and IE6. Sorry I'm not set up for more comprehensive testing.