Comfortable way to archive and log terminal input
Maybe not quite what you're asking for, but an elegant solution: Press CTRL-R and it will invoke a search through your entire history. Pressing CTRL-R again will display the next search result.

Another solution would be to use something like TextExpander etc. You define your commands there and call them by shortcuts. Unfortunately it doesn't work with the built in OS X shortcuts from the System Preferences - I did not get it working.