Not all DM metagaming is bad. DMs have a lot of work to do. They have a lot of NPCs to manage. If the PCs come up with plans or other parts of discussion that would be reasonable for the NPC, given his intelligence, skills, and resources, then I may incorporate it even though I never thought of it in advance.
The question really is balance. Yes, there's that word again. In this case, we're not talking about mechanical balance but fairness. I will not constantly screw my players even if I do use their discussion against them in some ways. I will not play all of my monsters like tactical geniuses when, by the stats, they clearly are not. I will not exploit holes in the rules unfairly. In short, I will take a balanced approach to the game in challenging the players' abilities and challenging their PCs' abilities, in coming up with situations that are tactical challenges and provide interesting and fulfilling role playing.