Thanks for explaining. I think I understand... you want the order they're listed on the Kindle's home page to match the order the files are listed in when browsing the folder (at the OS level)? Otherwise, you could just put whatever you want in the EXTH header and ignore the filename.
Either way, thanks for sharing the code.