OP, that's definitely doable, but there is not too much info in your post. As far as I know there are no security issues, there are people keeping sailboats at Samui's bays without living there, haven't heard of any issues.
Moving from the west to the east coast of Thailand is a bit of issue, as the trip is a few thousand kilometres.
There is marina in Phuket and I believe also in Pattaya. From what I heard relatively cheap place to fix liveaboard sailboats is around Satun.
All normal visa requirements would apply.
noonsite.com would have some recent post and feedback from cruisers visiting Thailand. Also check cruiserforum.com.
That's my tentative long term plan as well, but not necessarily around Thailand.