One thing to remember about the GoPhone route:
Apparently, in the past, if you opted for a GoPhone package that included any promotional additions (such as the first XX minutes free, or other offers like that), AT&T would add a temporary, 6-month restriction on the GoPhone account (not on the phone, but on the account linked to the SIM card).
In that case, apparently, the GoPhone account could only be used in conjunction with the bundled GoPhone handset with which the account was purchased. Before those 6 months were up, your SIM card would not function in any other phone. After those 6 months passed, your SIM card would work in any compatible phone, including any AT&T-locked iPhone.
If you bought a GoPhone package that did not include any bundled promotional additions, then the SIM would work out-of-the-box in any compatible phone, including an AT&T-locked iPhone.
I don't know for sure if this is still the case, but it was widely reported, as I recall, around the time of the 3GS launch.