This shouldn't be too hard to implement, sorting is already built into RoundCube so all we need to implement is the follwoing:
If you click on the 'Subject' heading it would sort as per now, however it would ignore the RE: at the start of the message, then we just need to stagger each message below the original. The only problem would be displaying items from both Inbox and Sent Items to show the entire message threads. It would be easiest to implement once there is a plugin framework for roundcube.
Regards,
Daniel Davis
Centre IT