Please note that in order for the UI to behave properly in Firefox when doing a custom object/embed, the embed must follow the following format:
<embed width="" height="" [other stuff]> </embed>
I discovered this after much searching when I found the regex that it validates embed code against is structured such that things must be in that order, otherwise the UI will not behave as expected and the </embed> tag will be stripped from the editor in firefox.