One of the linked questions mentioned setting the innerHTML of the script tag element. I think this might do the trick
function load(toEval, callback){
    __global_callback = callback;
    var node = document.createElement('script');
    node.innerHTML = toEval + '; __global_callback()';
    document.getElementsByTagName('head')[0].appendChild(node);
}
load("console.log('before...');", function(){
    console.log('...and after');
});
