Below is an input method for Emacs that will type text in reverse:
(defun reverse-input-method (key)
(if buffer-read-only
(list key)
(if (setq new key)
(list new ?\2) ;; ?\2 == backwards char
(list key ?\2))))
(defun reverse-input-activate (&optional arg)
"Activate reverse-im input method.
With arg, activate reverse-im input method if and only if arg is
positive.
While this input method is active, the variable
`input-method-function' is bound to the function
`reverse-input-method'."
(if (and arg
(< (prefix-numeric-value arg) 0))
(unwind-protect
(progn
(quail-hide-guidance)
(quail-delete-overlays)
(setq describe-current-input-method-function nil))
(kill-local-variable 'input-method-function))
(setq inactivate-current-input-method-function 'reverse-input-inactivate)
(setq describe-current-input-method-function 'reversr-input-help)
(quail-delete-overlays)
(if (eq (selected-window) (minibuffer-window))
(add-hook 'minibuffer-exit-hook 'quail-exit-from-minibuffer))
(set (make-local-variable 'input-method-function)
'reverse-input-method)))
(defun reverse-input-inactivate ()
"Inactivate reverse-im input method."
(interactive)
(reverse-input-activate -1))
(defun reverse-input-help ()
(interactive)
(with-output-to-temp-buffer "*Help*"
(princ "Inserts text in reverse order.")))
(provide 'reverse-im)
(register-input-method "reverse-im" "UTF-8" 'reverse-input-activate "<<"
"Input method for \"typing characters in reverse\".")
You could save it in, for example, ~/.emacs.d/reverse-im/reverse-im.el and then add these lines to .emacs
(add-to-list 'load-path (expand-file-name "~/.emacs.d/reverse-im/"))
(require 'reverse-im)
Then use KeySnail Firefox plugin to call emacs when you need to edit text (you'd need to set your text editor in .bashrc or whatever you use to store your shell variables to emacsclient
and use K2Emacs plugin of KeySnail, or modify your .keysnail.js to invoke Emacs when you need that.
There's similar plugin for Vim called Vimperator, but I didn't use it.