Sounds like to many border bounces and not having the correct visa if you was winging it staying in Thailand, I would wait 6 months then apply again, it you have been rejected no doubt you will be refused entry and sent back so I honestly wouldn't risk it and waste money just leave it 6 months then visit again and apply for the correct visa to stay here long-term