After Achan, Israel needed encouragement to know God was with them, so we get a lengthy account of the victorious battle of Ai.
Deuteronomy 27-28 is key to understanding Joshua 8:30-35. This is a renewal of the covenant, reconfirming that God gave the victory and that Israel resolves to keep covenant with God. Schaeffer spends a lot of time discussing Ebal and Gerazim. Ebal was the mount of curses, and the altar is built on it, as if to show Israel that they will sin, and they will have a means of atonement. We come to God through the altar, eventually through Christ, not through keeping the law.
It's a little surprising but not impossible for Israel to go to Shechem from Ai unopposed. We don't need to assume Joshua 8:30-35 happen later in the story. Israel was zealous to renew covenant as soon as possible, and God protected them from any possible enemies around Shechem that they hadn't defeated yet.
That said, verses 30-35 could be out of order. The "Now," or "At that time" particle can be chronological or used for emphasis without reference to time. NKJV "Now" is better than ESV's "At that time", in my view, as ESV requires a chronological reading of the particle, while NKJV "Now" allows for either, and gives the emphasis element.
The main point is to connect 30-35 with 1-29 logically (and theologically). Because of the victory God gave, Israel returned thanks and renewed covenant with God. Military victory is connected with the covenant blessings/curses God promised Israel. But the victory is a result of God's blessing; the victory doesn't bring God's blessing. The sacrifice on the cursed mountain does that.
Galatians 3:13-14: "Christ has redeemed us from the curse of the law, having become a curse for us (for it is written, “Cursed is everyone who hangs on a tree”), 14 that the blessing of Abraham might come upon the Gentiles in Christ Jesus, that we might receive the promise of the Spirit through faith."