There is no Thai consulate or embassy within Thailand. And technically you can not buy a visa at immigration. Yes, some people use agencies and pay tons of cash and get it done. But is is not cheap.
I think you need to go through the normal steps of cancellation of your extension, leave Thailand, get a new SETV, return to Thailand, apply for the Non-O extension.
Mr.
@Tod ********
is the guy to answer this for sure, but give him some time to reply as he is on vacation overseas.