https://forum.renoise.com/t/idea-for-a-simple-advanced-edit-scripting/18824
And of course this is not as comfortable as your suggested solution, but you can right now use Renoises clipboard for this. Select something in the pattern editor, hit Control C, alt tab to your script tool to do whatever with the clipboard xml data, then alt-tab back to Renoise and paste. Thats how the current tools do it http://www.renoise.com/download/tools/