Hi Adam
Have found a fudge that works, it may help you in debugging etc.
var txtToInsert = 'This is the html and script etc to insert';
var txt = document.getElementById('<%= editor1.ClientID %>');
txt.SetActiveTab('code');
txt.ExecCommand('SelectALL', false, 'SelectAll');
txt.ExecCommand('pastetext', false, txtToInsert);
txt.SetActiveTab('edit');