Pretty sure if you stamp out and back in you need to do tm 30. If you travel within thailand and return to the same address, a tm 30 is not needed upon return, if you have done the tm30 at that address previously.
This is what was told to me by an IO.... but tit, I'd just call and ask to be on the safe side.