I would like to thank forum members for their suggestions.
I particularly thank fountainhall. Yes, indeed, it might be a good idea to set up a company in Hong Kong {which is relatively easy} and then get paid for any consulting work in Thailand through that company.
Several "major" universities seem interested in sponsoring me for a work permit, but I am not sure how much I would enjoy teaching civil engineering to Thai university students. Thai professors who have studied abroad speak decent English, but the undergraduate students might not be able to really comprehend my English, much less my French.
But if the universities could sponsor the visa, and I could do some consulting work on civil engineering projects, the situation would not be so bad.
Civil engineering projects in many countries involve a lot of bribery, embezzlement, shoddy construction, and violation of labor and environmental standards. I wonder about Thailand; I would gain some understanding.