You did well. My Thai "teaching partner" would regularly spend a good 10 minutes of every 50 minute class period admonishing and berating the students just to get them in line. Your student was "testing" your will and your authority. I think now he has learned his lesson. In my past experience, this student may now become one of your favorite pupils.