If I show up in Thailand and pick up the 30-day tourist visa upon arrival, do I have to leave the country to apply for the 60-day visa?
Yes, actual visas are only issued outside Thailand:
As a foreigner, you are required by Thai Immigration Law to initially enter the Kingdom on a Visa if you wish to have a long-term stay in Thailand.
This can be a visa (tourist visa for 60 days or non-immigrant visa for 90 days) issued by a Thai Embassy or Consulate outside of Thailand.
Also note that the tourism visa is 60 days, although it can be extended once in the country to 90 days.
If you want 90 days off the bat, you need to apply for a non-immigrant visa, and that in turn requires proof of business (sponsored by Thai company), education (study in Thailand) or retirement/marriage to a Thai national. See the aptly named thaivisa.com forums for the latest scoop on what this means in practice.