From last night's (3x) Game:
PC (returned from following Suspicious Priest into Hidden Passage filled with Undead Guards):"I followed him! And there's a tunnel! And undead things! Which see in the dark! And..."
Other PCs:OK, this buff on you, that one on you, this other one on me, activate this, turn on the other...
3x can feel like an MMORPG, too. ("OK, before we go into the instance, everyone refresh your buffs...")
As for 4e...assuming spells can be cast which don't require hitting things first ("I detect magic!" "You can't, you didn't hit someone."), I'd let them be cast as soon as the players were aware they were *about* to be in combat, with the caveat that if the fight didn't begin in <5 minutes, the duration would end and that would count as a 'per encounter' use, unless they rested to recover it. From what we've seen, there's not going to be that great an advantage to 'going in' buffed.
Pretending the universe knows if you're "in an encounter" or not is head-go-splodey for me. I would rather say "The spell lasts for five minutes from when you cast it, and you need a five minute rest to re-cast it", and just make it clear that for reasons of playability, NOT reality, we treat all encounters as "lasting five minutes", whether they do or not. If the PCs immediately rush to the next encounter, too bad, despite it only "seeming" like a few rounds, it "really" took longer. 4e is going to demand much higher levels of abstraction than 3x.