All ISP's (not only in Thailand) keep connection logs for 6 month(?).
I suppose that you have signed up for that SIM card and the internet service on it so they will then know who had that IP and to which other IP it connected to at a certain time together with your name.
They don't keep data logs (the political comment) so it may be a bit difficult for them if you are only a bad boy once.
Do it a couple of times and it will be easy to pinpoint you.
A BAD political comment may make them block Thai access to TD so we should all be careful about what we write.