SVGAlib's savetextmode and restoretextmode might do it, but haven't used
them since they used to crash on my previous card and haven't tried yet on
the new one.
What I usually do is first try running SVGATextMode and if that doesn't
work starting dosemu, typing vgaoff and exit there, and then fixing the
text size with SVGATextMode. If keyboard is in raw mode I use the dumb
terminal to fix that. Works 95% of the time for me, though last time I had
to fire up X to compile dosemu first...
Maybe someone familiar with vm86 and such stuff could write a small
utility for running the BIOS display rest code :)
Jouni