I found spy very useful for distracting enemies. Everyone eagers to kill the spy, sniper stops focusing on sniping, engie starts run around with desperate spy check, demo usually stops spamming and starts melee spycheck etc. Real deal is pyro or heavy, they're my priority objects, the others I use to make some confusion.
Also sap the sentry when your team is nearby, or engie gone. When there's engie right at the sentry, and nobody covers you, then you just give away your location.
When reloading CnD/IW, uncloak and ACT like enemy. Best for CnD/IW reload is sniper class, because it stays in one spot, worst is engie and scout. Engie because engie never stops wrenching around, scout because he's incredibly fast, and double jumps a lot. Never stay in one spot for reload. Takes too long and makes you sitting duck. Also use IW/CnD for short trips only. When you come out of spawn, be you, dress as someone else later. Enemy spy can wait right next to your spawn

Use CnD realod while cloaked only when neccessary, otherwise use it like faster relaoding IW

Pay attention to enemies. If you're cloaked as one of them, do not decloak. Just run away or kill him discretely. Two same guys next to each other are really obvious.
Run for your prey less then 3 seconds away. That's crucial. Every spy-concerned player (and there is always noob spy before you, who makes them spyranoid) turns around every once a while. If you follow someone for too long (i.e. 10 secs) you become suspect. And simple spy check is immident.
Sometimes you can pass the spy check. If you do (especially when engie hits you with wrench except for Southern Hospitality), stay with him and then make your move.
Ethernal reward is great thing. Until your last backstabbed prey revives. He usually says "Spy as me" and then, you're really doomed.
Always check for sentries around before decloaking with ethernal reward/firing.
Sapperspam is useful when there is only one engie and nobody covers him. Engies really hates this

Sometimes enemy can make even more simple spycheck, most anoyingis "shoot before you come any closer" or sometimes in LAN parties it could be "tell my name when you're closing to me" or "say Yes, No or Medic in voicechat" (it's shown as (VOICE)ThatGuysNick: Yes/No/Medic at the teamchat). This is the ultimate spy-test and only way I pulled through - using ethernal reward and DR, making some mess so they start furious spy checks and then run away. In this case, your team needs to be ready and close. When you do the chaos, where everyone melee spycheck the closest corners, and heavy or two come in the range... well than you have real massacre

If someone ignored you decloaking, run away and change cover. Engies sometimes ignore you to get you in pyro-trap.
Help your spies - shoot at them when they are around enemies. You support their cover (bonus is spycheck).
Be mainstream. Coming opposite way than emeny is really obvious. Great thing is going backwards, from some battle, disguised as someone hurt. I got never spycheck after this. After a while, when healed (your disguised you I mean),runback in battle. Just be your enemy, like fallen angel have written.
MEDIC - never ever ever ever ever heal spy. Only exceptions are when he calls you or setting up (time before round starts). It's the stupidest thing you can do and it kills you both (usually).
Those are my hints, my way. You can take whatever you want, or use something oppose me at the battle. I counted with it when I posted it
