Good question! And one every GM has to deal with from time to time I would think. I'd probably pick one or two of these:
Keep the pace. Part of your story revolves around urgency. Let them feel stressed out, make your encounters heave for breath, more so the closer the party gets to the final boss fight. Try to make them feel guilty for even the slightest pause, thorough searching etc.
Help them recover. Let the PCs discover an old and forgotten crate with a nearly empty healing wand, some crumbling restoration scrolls and a six-pack of useful potions with faded labels.
Surprise the badguys. Villains also need to deal with changing schedules.
- An important ritual component is lost or spilled on the floor during preparation and a minion is dispatched to the nearest town to procure more.
- A pair of blundering ogres accidentally discover the villains hideout and must be dealt with, depleting resources.
- A cloudy night sky diminishes moon power, so the ritual is postponed for a day or two until weather clears up.
- The players can mess up the villains schedule. Give them a chance to funnel a swarm of dire bats into the villains part of the dungeon, thus creating havoc and buying time.
There are a ton of issues with that.
That doesn’t automatically mean it’s the wrong move, just that it’s fraught with problems.
Ultimately, most people feel that roleplaying works best when everyone, ya know, plays a role. As in, behaves as their character would, based on what their character knows, rather than how they would, based on what they know. This is usually the goal.
However, most groups don’t explicitly enforce it. It’s considered bad taste to meta-game, it’s considered good roleplaying to stay in character even when it hurts, but there aren’t specific rules about it, and in many groups the DM claiming “your character wouldn’t do that” is a gross violation of the player’s area of control (i.e. their character). Statements to that effect have been reasons to leave a group for a lot of players in a lot of situations, and while I am lucky to have never played under a DM who seriously thought that was his business, if I were I most likely wouldn’t tolerate it.
But your group may be different. You are expressing frustration with the status quo, and that is presumably a feeling shared by others. This could be a solution to that, and ideally the questioning would come more as a reminder than as any real attempt to control others’ characters.
That said, the objections of some people in your group suggests that not everyone feels the way you do. There are people in the group who either A. feel they are not metagaming, or B. feel that the metagaming is a good thing, and in both cases there is not a problem. Both perspectives are valid, though B is a bit unusual. (There is a third option, C, wherein people recognize that there is a problem but dislike this solution; I would probably fall in that category. That said, these people are probably already doing their best not to metagame.)
So what you really need to do is discuss metagaming, what is or isn’t and how much is or isn’t appropriate. You need to have a mature discussion, and you need to listen to others’ opinions, perspectives, and preferences. More than likely, no two people in the group will exactly align, but hopefully everyone will be near enough to some common ground that a compromise can be made.
And once you have that, you really probably don’t need this rule. You might include it, in theory, if people felt they needed to be reminded or “called on” for metagaming, but I really cannot imagine any point where it is a good idea for a DM to say “no, your character would not do that.” You can question an action (though even that might be disrespectful), but ultimately the DM has to back down there because his authority, so absolute otherwise, cannot control player characters like that, or else the players have nothing and there is no game.
Under no circumstances should this rule be even considered unless everyone wants it. A group that agreed it would be for the best to get called in this fashion could work. But if some do, and some don’t, it is not a reasonable thing for a DM to expect of players. The individuals who requested it could get called on it, but you should never tell someone he’s not playing his character right, after he’s specifically told you to stay hands-off on that subject. Were it me, I would walk out the very first time it happened, assuming you convinced me to stay at all, which I tend to doubt.
There can still be a compromise even if people object to this as a rule, of course; that’s actually normal for most groups. E.g. if you say something like “I won’t call you on it, but it is your responsibility to avoid metagaming and this game isn’t going to survive if you don’t.” and he says “OK, I will do what I can,” that is a workable situation.
But if no compromise can be made, if some feel that their behavior is entirely appropriate and refuse to modify it, and you feel your expectations are entirely reasonable and refuse to modify those, then you have learned this without going through it the hard way: you are not a compatible group of people who are looking for the same game. That’s pretty much what you’d discover if you tried to “enforce” these rules without a compromise, but there’d be a lot more ill feelings. Better to skip that step.
Best Answer
Let's first talk about adventure design. If you're hiding anything that's important to your story -- in other words, anything where the game would be worse if the players somehow failed to find it -- you need to make sure your adventure includes lots of ways to find that thing. There's an article about the Three Clue Rule that goes into this in more detail:
Let me say that a different way: your goal in D&D is not to simulate everything that might happen with high accuracy and fairness. Your goal is to run a fun adventure. Solving problems is fun; giving up and going back to town because the character wasn't smart enough to solve the problem is not fun.
Having said all that, let's now assume that you really don't care if the players find the secret door, and let's actually answer your question. : )
You can avoid leaking map information to metagamers by using a much larger map than your actual dungeon. Most of the map area will be blank unexplorable space, so that the players can't tell the difference between secret room and unexplorable.
You should assign penalties for spending too long in a dungeon. Dungeons are dangerous places! Even if the players have cleared all the encounters on the map, there can still be wandering monsters -- or, there could be more monsters trying to move in to the newly cleared dungeon. If the players take too long searching, they should encounter monsters which they have to fight.
The players might also be on a deadline if they want to return to town before nightfall.
If you haven't assigned any penalty for spending time, it really just makes sense for the characters to spend some time searching a dungeon, regardless of metagame information!
You've also asked about using metagame knowledge against monsters. I'll echo YogoZuno's excellent answer: