Some phones will not give you the option to enter the unlock code until you place a "foreign" sim card inside.
If you don't have one, perhaps a friend is on T-Mobile? Just borrow his Sim for a few minutes. Or go into a bar and offer a beer to someone to loan you his/hers.
Better sooner, than later, before your trip.