This could mean understand the beginning and the end of each tag, control at the end what ones were not closed (not counting tags where closing is at least optional, like p, option, or even br ).
But if this is done, then another thing could be implemented also: limitation of "valid" html tags, as most sites do. The list that i.e. Kuro5hin use is this list, but a lot more sites displays the allowed html in a more or less restrictive way.
In the other hand, at least for wiki pages the HTML could give a look and feel of a page that plain wiki can't, restricting the html tags that can be used could be ok for blogs, or articles, or forum posts, where content is more important than look, but for wiki pages? You can have a policy of having anyway a list of allowed html by design anyway, so user now that twill be a limit on how much they customize wiki pages, but that will also means that an user will not break site visibility using some tag (some browsers can have problems if someone in a coment put a /html maybe?). And this could have side effects with the wysiwig editor, but anyway, still thinking that is a good idea.