How to parse PHP variables in drupal_add_js in template.php
Just remove the print function from your code:

drupal_add_js('jQuery(document).ready(function () { alert(" '. $site_name .' "); });',
  array('type' =&gt; 'inline', 'scope' =&gt; 'footer', 'weight' =&gt; 5)
);


Looking at the javascript Window alert() Method it has this syntax:


  alert(message)


And the message parameter has the type string

PHP's print function prints to the output buffer and returns an int. It has this definition:


  int print ( string $arg )


So your code prints the variable $site_name to the output buffer and returns an int, and your string for the alert is then an integer and you have printed to the output buffer which you did not want to do.