Let's see, mistakes I have made...
As noted above, railroading is bad (m'key?). Things are a little different if you're explicitly running an Adventure Path, although even there you should maintain at least some flexibility. When not running an AP, you certainly shouldn't be forcing the PCs to follow your "one true path", and neither should you secretly have an "invisible path" for them to walk. If your story is compelling enough, most players will walk it most of the time without you even trying anyway - but if you try to force the issue they are likely to rebel.
At the same time, you really should be providing some guidance to the players about what they can do. Even in a true sandbox game, you essentially have to present them with the 'menu' of interesting things to see and to do, to give them some basis for making decisions.
Players really hate it when you take something away from them. If you give them the "Artifact of Ultimate Doom", find it breaks your game, and are forced to either take it away or heavily nerf its powers, your players will hate you for it. They will not, however, have a problem if you never give them the "Artifact of Ultimate Doom" in the first place. (My suggestion with something like this would be to usually give them the de-powered item, and then gradually add powers as they are discovered. Gradually give, and you'll never need to take away.)
(Incidentally, the same applies to the use of rust monsters, level-draining undead, and even just dropping heavily armoured characters in large bodies of water. Use any of the above with care.)
I once created an NPC villain with a fatal weakness which meant that one particular player was able to defeat him with the application of a couple of low-level powers (and one part of that weakness made the NPC unable to recognise this problem and retreat). This turned what should have been a big, showpiece encounter into a major anti-climax. Oops! (The lesson there: build your encounters with your PCs in mind, not some platonic ideal of what a party should be.)
Conversely, I once had a major NPC suffer a massive critical hit from a player, turning another major showpiece encounter into an anticlimax due to three lucky rolls in succession. I let the result stand, and am going to claim that as good DMing. Basically, I would always have another BBEG to use, and my group still talk about that incident with fondness.
Choices should be meaningful, and you should give some basis for players to make their choice. "You reach a T-junction, do you go left or right?" sounds like a choice, but it's not really - without any context there's no way for the players to decide.
Try not to let the players get bored. The scene in Lord of the Rings where the party are camped outside the gates of Moria for hours while Gandalf tries to remember the password is all well and good, but in an RPG it is likely to lead to bored players. If the group must answer the riddle to proceed, then as soon as the players are starting to get restive, you will have to give them the answer. Better by far would be to not put them in the situation in the first place: either have the riddle guard a treasure room that the PCs don't have to find, or have the riddle be only one of several ways to proceed (it can even be the easiest way to proceed if you wish; it just shouldn't be the only one).
Speaking of enforcing a single solution to problems: don't. A riddle at a door could probably also be bypassed by having the Rogue pick the lock, having the Wizard use magic to open the door, or have the Fighter bash down the door. Even if you think there's only the one answer, there isn't - if your players come up with something you didn't think of, it's usually better to let their result stand. Remember: you will always have another challenge to put before them.
Don't let the players solve every situation with the same solution. There's a section in the "Munchkin's Guide to Powergamers" that talks about how the skill 'gun' can be used in every situation to achieve victory. It's played for laughs, but there's some truth to it - if you let them, some players will be quite happy to resolve everything by simply bashing it down. (The easiest way to prevent this, incidentally, is to keep mixing up your encounters. Include plenty of monsters, but also deadly traps, social situations, monsters with heavy DR but low spell resistance, and so on and so forth. Doing this also gives every character a chance to shine almost effortlessly - the Cleric may be less help against orcs, but he'll shine against zombies.)
Two aspects of 'table mastery' to consider:
As DM, you are the person best placed to ensure that everyone is having a good time. I have found that, at most tables, one or two people will naturally be the most vocal, the quickest to speak, and therefore come to dominate the table. These are often the most experienced roleplayers, and they may well also have the best optimised characters at the table as well. That's all well and good (and a 'player leader' can be a very useful thing), but it may come at the expense of a quieter player, one who is shy, or inexperienced, or whatever.
Be sure to address this quieter player! Ask him what he thinks in a given situation, ask him what his character does. And strongly resist the possibility of the louder player telling the quieter player what he should do! This may be a natural temptation, and the suggestions may actually be good, but if it comes at the cost of the quieter player being engaged in the game, then it's a bad thing.
Secondly, you should always try to keep the game moving, and especially when players get distracted you should try to get them involved once more.
This is particularly noticable in combat situations. At my table we have a rule that when a player's turn comes up, they have thirty seconds to start declaring their first action of the turn, or they lose their turn. (Of course, that action may simply be "Delay".) Bluntly, they should have been paying attention to the situation, so should have a fairly good idea of what they want to do. And, equally bluntly, if they needed to look up the text of one of their spells/powers, they've had at least a couple of minutes since their last turn to do it.
But this also applies to non-combat situations. As soon as some players start to get bored, it's time for something to happen. (I also have a strong preference that players handle "shopping trips" for their characters between sessions. Obviously, that's not always possible.)
When in doubt, have a bunch of orcs kick down the door.