Thanks SpiderMatt and Leep. I gave you karma for your support.
The fix ended up being much easier than I thought and now I'm good to go. Redownloading the book file didn't work, but I upgraded everything to the latest version and now it all works again. I guess I ought to stop and think rather than panicking.

It just took me SO long to figure the script out in the first place that I thought I had a real problem on my hands.