Where should I define the "drupal_stale_file_threshold" Drupal variable?
Settings.php makes sense if the setting isn't supposed to change.

A module may be useful if the value of the setting is just temporary.

A themes template.php file is absolute not the place to put it.