I can’t understand exactly what you are trying to do there, but Selection.TypeText will hide the selection to the insertion point, so you actually don’t have the characters selected by the time you try to “return the font”. You need to either reselect the text or use the Range object instead of the selection to identify the text that should be affected.
The reason you get the error in the line:
Set Selection.Font = oldFont
... because - unusual and perverted - you should not use the Set keyword when assigning to the Font property. Instead of storing a reference to the Font object, the assignment simply applies the properties of the assigned font.
This is a very confusing API design, which is even more confusing because you do have to use the Set keyword when reading the Font property, but because it does assign a reference to the Font object!
And that is another reason why your code will not work, you are referring to the Font object, which you then modify, and your link points to the same Font object, which has now changed.
What you really need to do is create a new Font object to store the original font data, as shown below:
Set oldFont = Selection.Font.Duplicate
source share