by the time the hook is adding the code, the smarty will have already been processed - so adding smarty that you expect to do anything is not worth it...
the way to think of it is to create the content of the replacement and pass that via the jQuery - don't think of it as the template contains {$tag1} and so I can just replace it with {$tag2}... what you do is replace the content of {$tag1} with a predefined replacement value - could be text, html etc.. and more importantly, assumes that you can locate the specific position of the content you want to replace in the hook - with WHMCS, that might not always, and sadly too often, be the case.
replacing content with jQuery is not a magic bullet solution - at a push, i'd use it in a small limited way, but I wouldn't use it to make wholesale changes to a client area template, certainly not a cart template, unless it was a last resort.
if you take your footer hook and replace the copyright content...
<?php
add_hook('ClientAreaHeaderOutput', 1, function($vars){
$footer = '<script>$(document).ready(function() {
$("#footer .container").replaceWith("<div class=\"container\"><h2 style=\"color:red;\">New Copyright Footer</h2></div>");
});</script>';
return $footer;
});