Add javascript to a specific node
The node type will always have an underscore as the separator (not a dash) between words so the test would be:

if ($node-&gt;type == 'insert_pub') {
  // ...
}


But it seems from your question you want to test the URL alias of the node, not the type. To do that you need to use drupal_get_path_alias() to get the node's alias, and see if it matches:

$current_node_alias = drupal_get_path_alias("node/$node-&gt;nid");
if ($current_node_alias == 'insert-pub') {
  drupal_add_js('...
} 


Make sure you've cleared Drupal's caches so the new preprocess hook can be picked up by the system. That's the only reason I can think of to explain the calls to debug() not working, as they should.