My understanding is that superscript and subscript texts are basically just regular characters rendered with unique formatting capabilities in Office Apps (Excel, Word, PowerPoint, etc.). The HTML tags for "sup" and "sub" are presumably a reasonable counterparts for this.
For example, in HTML, A<sup>2</sup> + B<sup>2</sup> = C<sup>2</sup> will be rendered as:
A2 + B2 = C2
But if you copy it and paste into a plain text editor like Notepad, you will notice it will become:
A2 + B2 = C2
This is because any formatting properties (in this case, the <sup> property) would get lost for plain text.
As of right now, the Office Scripts APIs getValue and getText only handle raw texts and numbers without any formatting features, they behave identically.
Now you can try to copy this text and paste it into Notepad again:
A² ⁺ B² ⁼ C²
You'll notice the superscripts still look correct in Notepad this time!
I hope this helps you.