Mosh already negotiates an ssh connection, so I think you can do this safely - attempt to execute mosh-server, if the execution fails, open a normal shell and proxy the data back to the original screen.
You probably don't want mosh to do the proxying, since ssh (the client) is a pretty involved program - it handles signals, it supports port-forwarding, etc.
I sort of suspect SSH ControlMaster would work. I could imagine a mosh client script that sets ControlMaster=yes and a random ControlPath, tries to mosh, and runs ssh -o ControlMaster=no if it fails. And then unconditionally does an ssh -o ControlMaster=no -O exit.
You probably don't want mosh to do the proxying, since ssh (the client) is a pretty involved program - it handles signals, it supports port-forwarding, etc.
I sort of suspect SSH ControlMaster would work. I could imagine a mosh client script that sets ControlMaster=yes and a random ControlPath, tries to mosh, and runs ssh -o ControlMaster=no if it fails. And then unconditionally does an ssh -o ControlMaster=no -O exit.