Where should one add the js file (D7) to be attached to the custom theme's template.php file
Quick example of use in your theme's template.php 

function MYTHEME_preprocess_page(&amp;$variables) {
    drupal_add_js(drupal_get_path('theme', 'MYTHEME') .'/mytheme.js', 'file');
}


Reference : https://api.drupal.org/comment/14344#comment-14344