You've beat me to it, and I thought you said you were unfamiliar with VS 2010!
I have also checked in a separate console app "UnbundleX12" that will perform what you have described.
You can see the program.cs file here: http://x12parser.codeplex.com/SourceControl/changeset/view/8959#148453
It is basically using the same algorithm that you have done. I have added some error handling and help to the command line if the correct arguments are not recieved.
I also allow you to supply the loopid as an argument and override the default format string so that you can add leading zeros to to appended suffix.
I will include it as part of release 2.1.7 and update the document page on unbundling to include this.
I noticed that you had done some work identifying some of the errors in the 837 specification. I have done some clean up on it after reviewing the 837D, 837P and 837I specifications (pretty mind numbing). Let me know if you experience any adverse
affects to the changes I have made (not yet released). I was hoping to release it this weekend. Next month I was going to try and update all three on the 5010 version (I can only numb my mind so much in one month).
Thanks for being an active participant, I always love feedback from real users of the tool and will incorporate suggestions as quickly as I am able to.