I haven't tried the actions noted above, and I'm a bit of an Editorial noob — but just wanted to note there's an org mode plugin for Sublime Text. Those are written with Python.
Might be something in there to port (no idea as I'm not a Python, Org Mode, or Editorial "power user").