Make sure you read our FAQ article on buying a used BB from eBay - no matter hwere you are getting it. A used BB is a used BB and the info is the same.
An unlocked 8320 should work on any GSMnetwork.
Make sure TMO has the coverage where you need the device, not just around your home. A cheap plan is too expensive if you have no signal where you need one.
As for getting the unlock code, why not try to buy it unlocked? It will not work on UMA. You must have an UMA enabled device to do that. If it isn't, you can't make it so with software.