I think it would be helpful to provide a way to have documentation for TemplateStyles pages or even any reserved text from MediaWiki messages. This could be implemented like Scribunto already does or in some simpler way.
Specific use case for this: Russian Wikipedia requires all patrolled templates to have a template category, so instead of putting some category (probably of Category:Template sandboxes type) into CSS code, we could do it through software means. Some project might decide to document the entire styles themselves, and they should be able to do so.
I think that we can copy the specific implementation from Scribunto with a difference in that a default TemplateStyles implementation shouldn’t be visible until people configure it to be.