Ok, maybe not such a good idea
Having the extra calls in for add_custom_book_data and get_custom_book_data means it is averaging 10 seconds per 50 books. So instead of taking about 4 minutes on that first run it takes 23 minutes.
And subsequent runs are still around the 4 minute mark.
I commented the code all out and ran the analysis again - 2.5 minutes. Ahh well - users can just go make themselves a cuppa on their large libraries