I agree that the "!TAB xxx" looks like an ugly hack.
Let's keep the %%tabbedSection ... /% unchanged: the semantics are fine, as it just indicates another kind of rendering of the enclosed page content.
However, what is needed is a way to indicate that some of the !!!Section-headers are 'special'. They should be treated as tabs (tabbed-section), clickable toggles (various accordion styles) etc.
It actually would be sufficient to indicate a css-class to be attached to a !!!Section-header. The css-class would indicate that this section is a tab.
This approach would also allow to give specific styles to certain !!!Section-headers.
!!!%%tab First tab title
! Some embedded section
!!!%%tab Second tab title
This would render as:
<h2 class="tab"> First tab title</h2>
<h4> Some embedded section</h4>
<h2 class="tab"> Second tab title</h2>
I think the markup looks a bit bloated - but it is logical.
One more thing ....
This could become a generic markup extension.
When you add %% immediately after any other wiki-markup, it would insert css style info into the generated html.
EG: added style info to table cells, definition lists, ...
Also following style could be supported:
!!!%%(<css-style for this header>) Header title