I believe the following should work just fine:
<?php $doc = JFactory::getDocument(); ?>
<!--[if lt IE 9]>
<?php
$doc->addScript('https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js');
$doc->addScript('https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js');
?>
<![endif]-->
Note that I've defined $doc
outside the statement, just in case you require it elsewhere.
##Update for example:
Update for example:
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<jdoc:include type="head" />
Hope this helps