I usually define new keybindings in emacs using
\"C-x (\" --> (command kmacro-start-macro) \"C-x )\" --> (kmacro-end-macro) (name-last-kbd-macro) (insert-kbd-macro)
I made a package that allows pretty much exactly this at https://github.com/Silex/elmacro
It has some quirks but it works pretty well... for example, the following macro:
F3 C-e M-b M-u C-a C-n F4
Generates the following elisp:
(defun upcase-last-word ()
"Change me!"
(interactive)
(move-end-of-line 1)
(backward-word 1)
(upcase-word 1)
(move-beginning-of-line 1)
(next-line 1 1))