So I thought I'd give AutoHotkey a whirl, and it worked a treat. I think I'll use it a lot more.
I used this script to achieve the example you were after:
^F6::
Send ^r40{enter}
That binds Ctrl+F6 to the sequence of hitting Ctrl+R, typing in 40 and pressing Enter.
Edit:
Upon further research, I've found that there is this wonderful free tool, that complements AutoHotkey, called MacroCreator. It allows you to record your keystrokes, so you don't have to study the syntax of the AHK language in order to create your scripts.
(In the Recording Options, turn off Intervals and Mouse Movements, or else it records a bunch of pauses and mouse movements that you don't need.)
This whole AHK approach is significantly more complicated (looking) than Keyboard Maestro, but it seems to do the job, and if you're comfortable with a few technicalities, then this seems to be a great tool to use.