Is it getting him attention I would imagine it is , so it may be a good idea to ignore the habit, sometimes
children do things to get attention, so focus on his positive side not the negative, praise him when you see him doing something right.You have seen the doctor who has checked him out , next time he seems like he is going to throw up, walk away and do not feed into the issue once it doesn't get attention it may go away ...