The main thing limiting your write speed for a file is your hard drive speed. The only way of increasing that is to get a faster hard drive. I've got a feeling that this is not a reasonable option at this point.
Hash tables are stored in an unsorted format, and are (realistically) unsortable. Regarding DLL's, there might be, but I'm unaware of any.
Realistically (if not literally) using an @window would be your fastest option, so I have to wonder why you don't want to use an @window?
If coded properly, you could use the @window to do the sorting, and (probably) not even notice the window (ie: using a hidden window to do the sorting, and then close it automatically when complete)