I don't think it will be possible to do exactly what you are asking by working with nodes either. Scripts are loaded and executed when the page loads, with the exception that functions are run when called by an event.
var myjs = "<script>alert('hello js');</script>"; document.getElementById('test').innerHTML=myjs;
and run it is the key to your issue. The way you have it written, there is not a very clear way to determine if it has worked or not because there is nothing triggering the script to run. Also, there is probably an issue with the <script> and </script> tags in the first line.
Try: var myjs = 'alert(\'hello js\')'; document.getElementById('test').onmouseover=new Function(myjs);
Here is a full html page that sets a onmouseover and onclick. Hopefully this will get you pointed in the right direction:
In order to do what you want, you have to use the document object model to create a script element, give it the content that you want, put it somewhere on the page (ie: last element of head) and then it will not only be created but it's contents will execute immediately.