Visa Exemption (a.k.a. visa free, visa waiver) and Visa on Arrival are mutually exclusive. You get one or the other depending on nationality (see the map) or get a Tourist Visa in advance from Thai embassy / consulate.
The METV allows for multiple 60-day stays with possible 30-day extensions on each entry. It is valid for 6 months so can leave and re-enter right up until the last day and still get another 60+30 days. So if used carefully can result in nearly 90 days total. The downside can be extra cost and more strict requirements (proof of flights, employment, bank balance, etc.) plus must be obtained in home country, but some people are reporting that the Thai Embassy in KL is relaxing those requirements.
"What would be the longest possible duration for tourist visa"
If you mean a single-entry tourist visa (SETV) the longest possible stay is 60+30+7 days (with extensions). Then it's time to leave, either go get another SETV from Vientiane, Penang, etc. or do a simple border hop for another 30 day visa-exempt, but can only do this 2 times per year by land.
Problem with trying to juggle passports crossing between adjacent countries is immigration (entering Malaysia, for example) usually want to see your Thailand exit stamp in the same passport. Similarly when applying for a visa at the consulate they will require entry stamp in same passport as your application. But good luck - 270 days so far ;-)