I do this task frequently

(amazing how many poorly codewise, constructed books there are in the market)
My process does 2 things.
sets up for an auto TOC (the H tags. usually done after)
and
sets up for the split.
Do check the results, the roman pattern can miss AND inconsistent code (hand fixed??) is the other. You are 95% there in most cases, and the hand touchup is usually minor.