let's take a little trip back to summer 2004, shall we?
Van Helsing opened first in May, was expected to be a huge hit, it flopped. Next week came Troy, which was also expected to be a huge hit, but it didn't do so well in the U.S.
By the third weekend in May, the public was yearning for a good movie, then came Shrek, which was a good movie, took all of Helsing's and Troy's business. So Shrek had 2 whole weeks to gain some damn good momentum before Potter came out.
Sm2 basically got released in July. At this time, Helsing, Troy, Shrek2(good), The day After tomorrow(good), Potter(good), Dodgeball(good), Fah 9/11(good) are playing in theaters, taking away quite some money from Spidey. Spider-Man still puts up some good numbers in 2 weeks, despite the competition, then here comes some more pain in the following weeks with I-Robot, Bourne Supremacy, The Village, and Alien vs. Predator.
If the dates were reversed with SM2 and Shrek, i could see Spidey2 getting close to $500M easily and Shrek2 close to $400M.