The complication with attacking the parks in the order they appear in the books is that the rides are in the wrong order. But that could help you plan.
Start at Diagon Alley (in UOR). It’s huge and immersive and incredible and you could spend hours there. Have lunch at the Leaky Cauldron. The food isn’t great, but the experience is. Don’t have a dessert. (There’s a reason for this!)
Don’t ride Escape from Gringott’s because that’s Book 7. Take the train to Hogsmeade. (You are now at IOA.) There’s less to do here, but you have the castle to explore as you queue for Forbidden Journey.
Depending when you visit, the new Harry Potter ride (which is next to the castle) may be up and running. Ride that next. And Flight of the Hippogriff, where you’ll see Hagrid’s hut.
Then take the train back to London. As @ryan1 has said, it’s a slightly different experience. Dive back into Diagon Alley and it’s time for Escape from Gringott’s. Once you’re done with that, it’s time for dessert! Check out Florean Fortescue’s ice cream parlour.
As a bonus, if you’re feeling wealthy, visit Ollivander’s and buy yourself an interactive wand. You can do this at either location and both have spots for casting spells.
If the weather and crowds permit all this, that’ll be an incredible day. And if you don’t do it, I will certainly be doing it next year. Doing things in this order never occurred to me before.
Oh! But I’m not finished — and nor are you! You should do all this during daylight. And then go back and revisit both Diagon Alley and Hogsmeade at night for a whole new experience. End at the castle just in time for the Nighttime Lights show. Don’t forget to have dinner at the Three Broomsticks (Hogsmeade side).