So good that you didn't give him a punch and nothing serious happened. One of the various things thay can awake such anger is intense pressure, naturally one would want to find a way of releasing him or herself off such pressure and that's why your coursemate came in, an oppurtunity to release all the pressure on him.
Glad you didn't, only God knows how bad it could have gotten. Good side of it was that your coursemate would most times have a rethink before approaching you.