Situations like this is why I prefer to buy my equipment directly from Apple as opposed to third parties. If there are any problems, I'd rather not have to deal with middlemen.
Apple has a 30-day return policy on iPhones and have waived their restocking fee, allowing for a full refund even if the box is open. I'm not aware that either Best Buy or AT&T have waived their restocking fee on the iPhone 4. You should check the back of your Best Buy receipt for their regular return policy, which I believe includes a restocking fee on electronics. You should also followup with a call to Best Buy to see if they've made any exceptions for the iPhone 4. If they have not, you could try to insist they waive the restocking fee as Apple has done. There's no harm in trying.
As for your AT&T contract, you will likely have 30-days to cancel the contract you signed up for with the iPhone 4. In that event, you will revert to your previously existing contract with your upgrade eligibility restored. When I returned my iPhone 4 to Apple, they stated that my new contract was only "suspended" and that I would have to go through AT&T to "cancel" my contract and return to my old contract. You may need to show AT&T proof that you returned your iPhone.