How can I add the following line to the header, in a component?
<!--[if lt IE 9]><script language="javascript" type="text/javascript" src="js/excanvas.min.js"></script><![endif]-->
Not sure if it will work with any text, but you could try:
$document =& JFactory::getDocument();
$document->addCustomTag('<!--[if lt IE 9]><script language="javascript" type="text/javascript" src="js/excanvas.min.js"></script><![endif]-->');
I hope it will be helpfull.