How to call js and css file and replace the script in code
Create the JS and CSS files and then in the block view add them in the following way:

drupal_add_css(drupal_get_path('module', 'my_module') . '/css/my_css_file.css');
drupal_add_js(drupal_get_path('module', 'my_module') .'/js/my_js_file.js', 'file');


We have done something similar at a module we develop:
Guardian news