You can do 2 border runs in a calender year. And both 30 day stamps can be extend for 30 days at a immigration office in Thailand for 1900 thb each time.
I have a single entry tourist visa which ends in early January. I intend to do a border crossing and come back into Thailand on a 30 day visa exempt entry-I am Australian. Towards the end of that 30 days can I then extend my stay in Thailand by a further 30 days by getting an extension at immigration. Thus staying in the country for 4 months?