$40.00 for a new chain is ridiculous... a new quality chain should cost half of that and only takes a few minutes to install and one must ask what was wring with the chain that had 500 miles on it ?
They can only get away with this if you let them and you could always look for another shop.
Replacing the hangar, derailleur, and fitting a chain would take me about 20 minutes and I bill customers for straight time and not at any preset rate.
There are a few BF mechanics in your area who might be happy to help you with this work or you might think of buying the parts you need and hitting a local co-op to get some help with the installation.