As I said, written agreements are only as good as the paper they are written on. To take advantage of a contract, you, as the seller, would have to take the buyer to court to prove they broke the contract. If you actually almost "gave" them the horse for cheap, then the costs to go to court and hire a lawyer would be probably more than you sold him for. Been there done that with written contracts when selling dogs for $4000/5000 dollars. Once the person has the animal in their ownership, unless you are a co owner, its pretty hard to do anything about it.
If he was as well trained as you said, then you or your hubby should be able to have him back to how he was before he was sold in no time.
Cut your losses or buy him back. If the family friends are so broke and have no money, they will jump at getting cash for the horse.. Or they may tell you to take a leap, they are not selling... It is now THEIR choice, not yours as to whether they sell him back to you. Or to anyone else for that matter.