My old red cattle dog used to do this, made a dreadful wretching noise, then out to it. My vet felt it was a type of seizure, or maybe the blood being cut off in his brain for some reason. Only happened twice, the first time he vomited/made awful noises, tried to rush to me but landed at my feet, totally unconscious. Very sudden, and my efforts at getting him up thankfully snapped him out of it. The second time was more seizure-like. He again made the noise first, Ian pointed out that he was wobbling, then over onto his side and out to it, and this time there was a small amount of paddling of the feet. Definitely take him to the vet though, it may be something different, like a collapsing trachea, his heart etc.. Some things are easily treated by a vet, at an affordable price, and you'll find it much easier to cope with yourself once you know exactly what you are dealing with. One of my shelties for instance is doing really well on Prednil for her trachea problem, only rarely does she cough when on that med'. Good luck with him, I know the scare he must have given you. Been there.