Bind keyboard key (like F16) to execute command?
I just checked my 10.9.5 and 10.6.8 systems, and both have this under:
    System Preferences -> Keyboard -> Shortcuts

This allows you to bind a key to a command available via the menu, either globally (for all programs) or just a specific program.

If what you want to bind isn't a standard command, you can create an Automator plug-in that becomes available via the Services menu of a program, so that you can bind it to a key.