I’m shattered emotionally....

I am a lifelong dog owner and have also fostered several dogs from the SPCA, and helped friends train their dogs. My first question, and I am surprised that it hasn't been asked yet, is "Why was this dog put up for adoption in the first place?"
Every shelter has or should have someone who is educated in and able to evaluate behavior of all of the animals that come into the shelter before the animal is allowed to be adopted or even fostered. It is their responsibility to ensure the safety of the public. Having said that, I understand the heartache that this situation has caused, it is so easy to become attached to a pet, regardless of the species, and the situation that you are now in is extremely difficult.
My wife and I currently have 3 dogs, ranging from 65 lbs to 90 lbs, she also looks after 2 Great Pyrenees that belong to a friend during the week, the dogs are all exceptionally well socialized with people and other dogs, and we will never hesitate to step in and correct any unwelcome or aggressive behavior.
There are no guarantees, especially with a dog that has an unknown history, and you are not responsible for what the dog has been through before it came into your life, you gave it a home and a chance that someone else wouldn't or couldn't.
I have been nipped by small dogs twice, (both teacup poodles), and can tell you that it's not pleasant to be bitten, nor was it tolerated, one was a foster, who was quickly returned to the shelter, the other belonged to my first wife, and only because of that was given a second chance.
I am sorry that you are having to go through this, and wish you the best in resolving the issues with those affected. I agree with DIY that you should approach the neighbors and offer to pay their expenses asap, if for no other reason than to show that you accepted responsibility in the event someone does file a suit.

Sorry if I rambled on.