How do i add the next line towards the header, inside a component?

<!--[if lt IE 9]><script language="javascript" type="text/javascript" src="js/excanvas.min.js"></script><![endif]-->

Unsure whether it works with any text, but you could attempt:

$document =& JFactory::getDocument();
$document->addCustomTag('<!--[if lt IE 9]><script language="javascript" type="text/javascript" src="js/excanvas.min.js"></script><![endif]-->');

I really hope it will likely be helpfull.

You should use :

<?php
    $document = &JFactory::getDocument();
    $document->addScript( '/js/excanvas.min.js' );
?>

I'm trying to find how you can add the conditional statement though ...

UPDATE

Checking when the user representative is IE

<?php
    $document = &JFactory::getDocument();

    //Is it Internet Explorer?
    ereg('MSIE ([0-9]\.[0-9])',$_SERVER['HTTP_USER_AGENT'],$reg);

    if(isset($reg[1])) {
        //Yes, it is Internet Explorer
        $document->addScript( '/js/excanvas.min.js' );
    }
?>