This spell is vague (not counting the set numerical bonuses it gives you).
The wording on it either makes it incredibly powerful, or something the dm ignores in order to have a story.
I mean you could have a locked door that only opens if you enter 7618 on a series of dials. Foresight can literally let you do it first try, depending on how you want to read it.
Or perhaps "I really should cast Protection from Energy:Fire" or "Spell Immunity:Envervation/Force Cage/Chaos Hammer" before I do in this door.
Most dm's aren't going to go along with what this spell can potentially do, so it usually just gets relegated to giving the relatively minor bonuses.
Kind of like the old debate about "I cast the illusion of a floor over the pit trap using Silent Image" or "I cast the illusion of a wall at the end of the hall, and we'll stand behind that."