Wraith: I'll give it another shot as pyro or engineer (mini turret = AWESOME), and I'll switch servers. I typically play on the FUG servers since I've been playing there forever. I have a few backup ones I can try.
Also, last time I played engi, a spy walked up, survived a turret barrage that I was controlling since I was spy checking, sapped all my shit instantly, then decloaked and shot me before I could do ANYTHING. It's either bad luck or theres something going on.
Some servers have premium. People pay good money to be able to fly around and be obscenely broken. It's usually pretty easy to tell when a spy is sapping buildings located somewhere totally out of reach for a spy, or when a lone heavy gets shot twice in the head with a huntsman, kills you, and you see that you barely dented his health.
Avoid saigns and lotus like the plague. Hellsgamers and most of the 24/7 servers have spoofed player counts. Not so bad, but you'll enter thinking there's plenty of people playing when there's either nobody there or just a bunch of bots.
As for a normal spy situation, if you've been sapped and he's got backup, run away. A good spy will time sapping with his teammates, having them pop up the moment you're in trouble. Of course, the rest of your team works to prevent this from happening, but sometimes it can't be helped. It's no use dying when saving your buildings is impossible.
If the spy is alone and he's aggressive, switch to your shotgun and kill him. If he's being defensive, going in circles around your buildings so you can't reach him and trying to fake you out by staying in positions that he can escape from at a moment's notice, keep your wrench out and try to hit him with it. When he backs away, just turn your aim so you hit your sentry. If he tries to stop you, he'll get whacked, but if he doesn't, you'll destroy the sapper.
If spies are a major problem for your engineers, consider having the homewrecker on a pyro. You can light them up, airblast them away, and quickly whack the sappers off while he's dying. He'll probably run away, but he might dodge around and shoot with his revolver or come running back to spam the sapper. He's already burning to death. If he's shooting at you, he's not disguised and the sentry will take care of that in a hurry.
If he comes back to sap some more, he's suicidal. Just whack him with the homewrecker, give him a shot or two from the shotgun or flaregun, or light him up a little more, shoot him away with another airblast, and at this point the sappers should be gone, so if he's still alive, he won't be for much longer. A teammate should've helped by now, and the buildings aren't sapped anymore, so just chase after him with your flamethrower or secondary weapon.
Also, mini-turrets are fun. Don't use the wrangler with it, you'll want to fight alongside it. Try to hide it across from you, like under some stairs. You want to be opposite of it so that the opponent has to choose whether to attack you or the sentry. They'll probably choose you, so make sure you can get to cover while keeping him in range of the sentry. If he changes his focus, peek out and attack him again.
These sentries are highly disposable, you can build two of them without collecting more ammo, and they build quickly, so when one is destroyed you'll have another to cover you. It also leaves enough ammo to start a dispenser, which more often than not is the most useful thing an engineer can build, especially a lone engineer trying to sneak a teleporter behind enemy lines.
That's another thing worth noting. Every class benefits from being stealthy. Hide in a position where you can get behind and ambush somebody walking past you. You have a major advantage when you can avoid frontal assaults. The demoman's stickybombs are highly versatile, but were made for the purpose of blocking off doorways. Hide the stickies around the doorframe so they can't see that it's been trapped, and blow them up, preferably while taunting with the grenade launcher or bottle. Scottish Resistance now has a very rapid deploy rate and can trap multiple areas. It's not as good for spamming in direct combat and quickly neutralizing a threat, but for more cunning players it's a heck of a lot of fun! :D
Don't just sit defensively, though. You can use this trap as a barrier. Just shoot grenades at passersby, most people will be naive enough to follow you once you retreat back to safety. If you're using the ScoRes, you can even be prepared when somebody else immediately follows the last guy you blew up, all while setting up the stickybombs you detonated. Just make sure you know when it's time to switch things up a bit and go somewhere else. If the whole team finds you've been a nuisance for a while, they'll coordinate and deal with you, or they'll simply ignore your location. Your traps aren't useful unless you're surprising people with them, after all.
Make sure to read the official TF2 wiki, watch gameplay videos, and practice. Try to be good at every class. Countering an opponent is much harder if you don't have a hardwired understanding of their strengths and weaknesses.
...and please, remember that the Medic's new crossbow is very fun. It's not a strong weapon, so these medics have to play very defensively, but if you keep dodging when there's nothing to dodge, they won't be able to shoot you with it! It heals a good deal of health, from a safe distance, very quickly, so it can be the boost you need to take down a heavy. Having one medic heal a player while the other one has a crossbow shot ready for when health starts dwindling can be highly effective if you have the coordination to do it.
Think of it like a sandvich that you have a near-endless supply of, but you have to aim it instead of dropping it. Most people still haven't quite caught on to how to use this weapon very effectively yet...