Thanks for the explanation.
You had the legal right to terminate the sale agreement based on your contingency. The homes were not sold within the 45 day period and you had the absolute right to terminate your purchase agreement at that time. The fact that you receives an offer on the second home after the 45 days had run is not relevant.
If the escrow
company or whoever is holding your deposit, will not return the money to you, you will have to sue the holder of your money and the seller for breach of contract and for replevin of your money.
While the law dictates that you are entitled to the money back, if the seller will not direct its release then you have to sue. You can seek your court costs and attorney's fees as well in the suit.
You may reply back to me using the Reply link and I will be happy to continue to assist you until I am able to address your concerns, to your satisfaction.
Please remember to rate my service to you so that I can be compensated for helping you.
I wish you and yours the best in 2015,