I've been meaning to say for some time, it seems to me that the sorting function in VO really needs to be rethought. For one thing, I don't think there's anything in the documentation that describes how it actually works. And I think it only works properly in very limited situations, and may even have bugs then. Otherwise it garbles your doc and you have to use undo. Given the care that's given to other functions before putting them into VO codebase, I'm wondering how the current Sort function snuck in at all.
I have an idea for a reimplementation of sort that would be faster, more flexible, and cleaner with far less code. Basically it abandons the kludgy idea of sorting in place, and instead reads the desired headlines into a list structure, then sorts the list (using vimscript's built-in list sort), then uses the sorted order in the list to quickly and efficiently rearrange the headings (with their text and subheadings). Will be able to sort headings at any level and should be much more reliable.
Noel, maybe you want to add that to list of future changes? Or is the current sort function somehow not perceived to be sore spot?