I finished coding the workaround which I am referring to as "Safe Mode". I figured what the hell -- I already have a bunch of hours into this so I may as well see it to completion.
So what does Safe Mode do? It prevents the record of the first horse from being deleted no matter if it's in the xml file or if the user manually scratches it. I have done some minimal testing and it appears to work fine. The programs that didn't work correctly with the modified data file now appear to run normally.
What does the workaround mean to the user? It simply means that you will have to manually scratch the first horse in every race from within your program of choice (e.g., the NCG programs)
if necessary. The data will still be in the modified file even if the horse was scratched from within the scratch program. It will be minimal extra work as all of the other horses scratched by my program will not have their data in the modified file so they don't show up as needing to be scratched.
I still have to do some more testing and write up some documentation, and then code in some minor details and do some code clean-up, but I will release this as soon as I can. I won't send this version to the beta testers; I figure that the users here will tell me what's wrong with it.