Hi again!
I have rewritten the patch that enabled HTML based transclusion:
https://gerrit.wikimedia.org/r/#/c/132710/
I tried to address the concerns raised about my previous attempt, namely, how HTML based transclusion is handled in expandtemplates, and how page meta data such as resource modules get passed from the transcluded content to the main parser output (this should work now).
For expandtemplates, I decided to just keep HTML based transclusions as they are - including special page transclusions. So, expandtemplates will simply leave {{Special:Foo}} and {{MediaWiki:Foo.js}} in the expanded text, while in the xml output, you can still see them as template calls.
Cheers, Daniel