There is nothing as satisfying in TF as being an engineer and watching the enemy offense run into your sentry again and again, EMPing the heavy offense and generally being a pain in the butt.
Best workplace practices
Defending your sentry
This is very important.. use the sentry in a manner typical of many bullies. The sentry is used to take out an enemy after you have picked a fight with them. An enemy that is busy dodging your railgun or shotgun shots and grenades is often too busy to sneak up on the sentry and take it out. Occasionally you get a cool player who pretty much ignores you and attacks your sentry. Basically you need to do as much damage to the enemy before they have a chance to engage the sentry to minimize the chances of your sentry being taken out.
Grenades vs your sentry
Napalm grenades would be the most often used sentry killer in the game, because of a flaw with tf 2.8 and below the napalm grenade can airburst in mid-air and continue to explode from the initial explosion position. Enemy offense making "jump shots" can seriously make keeping your sentry alive a very difficult task. The main thing to do in this situation is heal the sentry half way through the life of the napalm grenade. The command "SBAR_ON" will allow you to know when it is the best time to jump into the flames and heal it. When the sentry get's to about 110 health jump in and keep healing it until you die or the napalm dies out. On many occasions enemy offense have announced that my sentry had been taken out (because they were too confident) and a group of unsuspecting enemy rush in and get mown down.
The dispenser
You can use the dispenser to help with the defense of the sentry. On Bam4 for example you can place your sentry on the hump in the corridor to the flag room, you place your dispenser just in the mouth of the corridor (just around the corner so that the enemy don't see the dispenser until it's too late). You can let the wimpier classes through but you can detonate the dispenser when one of the nastier classes get there (soldier, demoman, pyro).
Other dastardly tricks
You can be a true bastard by having a key bound that discards ammo and primes your EMP grenade. Ensure you have lots of rockets and when an enemy approaches discard at them and give them the EMP.....
Place a dispenser hidden in the enemy base and keep filling it up until it is full. Next build a sentry and upgrade it quickly... this will annoy the hell out of the enemy and will probably end with someone throwing a brick through your window. I've never actually done it (it seems to be the type of thing a prat would do) but i might have to go on a public server and try it out.
Bindings to have
//Class specific keys - engineer
bind "u" "detsentry"
bind "b" "build"
bind "CTRL" "detdispenser"