Is the following possible?

<script language="javascript" type="text/javascript">
//this is my main script in my document

var strAddScript = "<script language=\"javascript\" type=\"text/javascript\">";
strAddScript += "function doThis(parameter) {";
strAddScript += "//do really cool stuff here";
strAddScript += "}";

document.getElementById("AddScriptHere").innerHTML = strAddScript;

Here's my content
<div id="AddScriptHere"></div>
<!-- the above is a simplified version of a problem I am having. I can't seem to dynamically add JavaScript to a div using the innerHTML property. Is there another property I can use? Can I even add JavaScript dynamically to a div? If not, can I add JavaScript dynamically at all? If so How? -->