I always send a note of thanks and ask specifically on the phone or in person whay we wern't able to help them on this order to build knowledge for the future
Depending on the individual and the competition I may sometimes say:
Sory to hear that we won't be working on your project together. But tell you what, here's my business card, please keep it someplace safe and should anything go wrong, and for your sake I hope it doesn't... remember to give me a call. Our firm makes a pretty good living already cleaning up their mistakes.
The key is here is to lock in eye contact and stare straight through them when you do this.
I'm in software business where nearly 50% of all major purchases end up as orphanware. Some projects never get deployed.
Works great! There's nothing better than winning a deal back that you should have won in the first place. No need to discount the second time around. When they ask why the price increase... simply respond "The initial price was for our product and our installation. This second price includes our product, our installation and a reasonable estimate for undoing the mess that's been made since then. It was bad enough we didn't get the business early on, you can't expect us to pay to make up for their mistakes too!