I don't know how this kind of editing is called, but I've seen it somewhere before. Lets say you have an article with a heading, body and footer. In your own WYSIWYG editor, you have three buttons for each article section, or maybe a dropdown with those options.
When you paste the content of the article into the editor, you want to use the buttons one after the other to divide the content into the sections you want. First, you click on the line you want to define as the heading. You click on any part of the line, doesn't matter. Now you click the heading button, and it defines the line where you currently are, and anything below it, as the heading. Now you click on the line you want to define as the body, and click the body button. Again, everything on the line, and below it, is defined as body. You do the same for footer.
Is something like that possible with execCommand?