Is there an action hook that fires just before a template is loaded?

Looking at the Action Reference in the Codex, the first action listed after the wp action that sets up the WP object is template_redirect, which is indeed fired after all queried data is available, and before a template is selected. You can use the WordPress conditionals to determine if your intended template file will be loaded.

There is also the template_include filter which is executed after a template has been selected but before it is loaded, and gets passed the selected template file as an argument. But you should note that as this is a filter hook, it’s intended purpose is to replace a selected template rather than adding or removing functionality.

Alternately, if you are using your own theme, you could call do_action( 'my_custom_action' ); at the top of your template file and simply add hooks to the action to execute custom functionality.