Q:

How to override certain function in a module to disable the return value

Not sure how to explain this clearly but let me try.
/**
 * Implementation of hook_footer()  to insert Javascript at the end of the page
 */
function omniture_footer($main = 0) {

  global $user;

    $header = "<!-- SiteCatalyst code version: ";
    $header .=  check_plain(variable_get("omniture_version", 'H.13.'));
    $header .= " Copyright 1997-2009 Omniture, Inc. More info available at http://www.omniture.com -->\n";
    $header .= "<script type=\"text/javascript\" language=\"JavaScript\" src=\"";
    $header .=  check_plain(variable_get("omniture_js_file_location", 'http://www.example.com/js/s_code_remote_h.js'));
    $header .= "\"></script>\n";
    $header .= "<script type=\"text/javascript\" language=\"JavaScript\"><!--\n";

    $footer = '/************* DO NOT ALTER ANYTHING BELOW THIS LINE ! **************/'."\n";
    $footer .= 'var s_code=s.t();if(s_code)document.write(s_code)//--></script>'."\n";
    $footer .= '<script language="JavaScript" type="text/javascript"><!--'."\n";
    $footer .= "if(navigator.appVersion.indexOf('MSIE')>=0)document.write(unescape('%3C')+'\!-'+'-')"."\n";
    $footer .= '//--></script><noscript><a href="http://www.omniture.com" title="Web Analytics"><img src="';
    $footer .= check_plain(variable_get("omniture_image_file_location", 'http://examplecom.112.2O7.net/b/ss/examplecom/1/H.13--NS/0')).'/'.rand(0, 10000000).'"'."\n";
    $footer .= 'height="1" width="1" border="0" alt="" /></a></noscript><!--/DO NOT REMOVE/-->'."\n";
    $footer .= '<!-- End SiteCatalyst code version: ';
    $footer .=  check_plain(variable_get("omniture_version", 'H.13.'));
    $footer .= ' -->'."\n";

$script  = $header;
$script .= $extra_variables_formatted;
$script .= $footer;

return $script;
}

Now my task is to disable the $script to not show in unpublished articles. Is there any way to do this in template.php preprocess? 
Note: The below solved my question. Its 100% working in my end. Thanks
//Remove omniture tags in unpublish node
  if(arg(0) == 'node' && $vars['node']->status == 0) {
    $vars['closure'] = theme('closure');
    $omnitureTags = preg_replace( "/\<!-- SiteCatalyst code version: H\.19\.4 Copyright 1997-2009.+\<!-- End SiteCatalyst code version: H\.19\.4 --\>/si", "", $vars['closure']);
    $vars['closure'] = $omnitureTags;
  } else {
    $vars['closure'] = theme('closure');
  }

Put the above code in preprocess_page.

A:

The value returned from the implementations of hook_footer() is used from theme('closure').
function theme_closure($main = 0) {
  $footer = module_invoke_all('footer', $main);
  return implode("\n", $footer) . drupal_get_js('footer');
}

That function is called from template_preprocess_page(), which uses the following code:
  // Closure should be filled last.
  $variables['closure']           = theme('closure');

  if ($node = menu_get_object()) {
    $variables['node'] = $node;
  }

If you want not to print the value returned by hook_footer(), you have the following options. As you are talking of articles, I get you mean nodes whose content type is "article"; if you used the word articles to mean nodes, then remove the part that checks the value of the type property. 

Empty $variables['closure'] inside a preprocess function, which can be implemented in a module, or a theme (inside template.php). The following code is the code I would write for a theme.
function mytheme_preprocess_page(&$variables) {
  if (!empty($variables['node']) && $variables['node']->type == 'article' && !$variables['node']->status) {
    $variables['closure'] = '';
  }
}

If you are not interested in the content type of the node, then the code becomes the following one:
function mytheme_preprocess_page(&$variables) {
  if (!empty($variables['node']) && !$variables['node']->status) {
    $variables['closure'] = '';
  }
}

In the page.tpl.php file you normally find the following code to print the value returned from hook_footer():
<?php print $closure; ?>

Replace that line with the following one:
<?php if (!empty($node) && $node->type != 'article' && $node->status): ?>
  <?php print $closure; ?>
<?php endif; ?>

If you just need not to print the value of $closure when a node is not published, independently from the content type of the node, then the code simply becomes:
<?php if (!empty($node) && $node->status): ?>
  <?php print $closure; ?>
<?php endif; ?>

In this way, you can remove the value added to $closure from all the implementations of hook_footer(). You can also remove the part added from a specific module, if the module always adds the same string.
If you want to change the value returned from your implementation of hook_footer(), you can use menu_get_object() to get the node object associated to the page, if there is one.
function mymodule_footer() {
  $node = menu_get_object();

  if (!empty($node) && $node->type == 'article' && !$node->status) {
    return '';
  }

  // Return the value you would return when the node is published.
}

