The Emacs server
The best way to do this is to contact the Emacs server and run an Emacs Lisp command.
emacsclient -e '(with-current-buffer "*scratch*" (write-file "~/scratch.txt"))'
Or you could attach Emacs to the current terminal and do whatever you want there, such as switch to the `scratch buffer and save its contents.
Unfortunately for you, you need to start the server explicitly. I recommend that you add
(server-start) to your init file, because it is very useful, but if you haven't done that already, it won't help you now.
Sending input to Emacs's terminal
When you run
echo "abd" > /proc/$emacs_pid/fd/0, this sends the text to the terminal that Emacs is running on. Writing data to a terminal displays that data. You can't send input to a terminal: input is what comes from a terminal.
If you run a program in a screen or tmux session, you can attach to the existing session and continue interacting with the program. Both screen and tmux also support programmatically sending input to a program running inside. This requires having run the program in the first place, though, so it won't help you this time.
With Emacs, Screen won't buy you much over connecting to the Emacs server with
Sifting through core dump is an option. Emacs stores the content of a buffer in a single chunk, with a gap in the middle (the gap may contain arbitrary junk; if the last operation was a deletion, it's what was deleted).
The SIGQUIT signal causes a process to die a leave a core dump (if enabled) by default. However, Emacs catches SIGQUIT (it quits to the toplevel, which is convenient in some situations but doesn't help you). So instead you'll need to attach to it with a debugger and make it dump core. This has benefits over SIGQUIT anyway: it leaves the process running and works even if core dumps are disabled.
$ gdb -p $(pidof emacs)
You can then sift through the core dump to extract the data
Reattach Emacs to a new terminal
There's no Unix or even Linux feature to detach a program from one terminal and attach it on another. However, it is possible to attach a debugger to any program and make it open a different terminal. This can be hit-and-miss: sometimes it works, sometimes it crashes the program. There are several tools that attempt to do this as best as they can; see How can I disown a running process and associate it to a new screen shell?