Superscripts and subscripts

Is there a way to code superscripts and subscripts in text?

Not through Glk formatting commands, but super/sub-scripts for many letters and all digits are part of Unicode. Depending on which letters you need, that may be adequate.

Interpreters don’t always support all Unicode characters well, and it may depend on which font you use. Some but not all interpreters use fallback fonts to support unicode characters not present in the main interpreter font. I can say that the characters you can see in Wikipedia will also be supported in Parchment (though that does also depend on the OS fonts, however these characters are likely to be supported in all OSes now.)