Fixed the bahaviour of the general dialog creation logic so as to not close dialogs when enter is pressed and the event target is a TEXTAREA. Otherwise plugins with embedded ACE editor instances close when one tries to edit multi-line data. Added some semi-colons for good measure. Please assume that these are not optional and make a habit out of putting them where they belong.