Just an update. I flew into BKK today and was pulled aside to speak to immigration officer who asked about my purpose of visit, work etc. I was told because I had stayed more than 90 days in one sitting I should have come into the country on a tourist visa. After showing my onward flight they were able to stamp me on 30 days.