If anything, it probably would have been rash if not scandalous to try to stop him; certainly if you attempted during mass. Because then you make a scene, then others are scandalized-- if not by the scene itself, by the fact that now they are "aware" of this man's sins, and are all scrambling to figure out how to react, and asking themselves the same questions that you're asking yourself; not to mention the undue stress and strife placed on the priest who would then need to respond to the situation-- but he can't deny the man holy communion unless the man is a public sinner, heretic, schismatic, or excommunicate. But if he doesn't refuse Holy Communion to the man, then there is the possibility once again for scanda by the fact that an entire congregation is looking at this man and judging him to be unworthy of receiving Holy Communion, and expecting the priest to do something about it.
So no, you did the right thing, at least judging by the information available.
If you have very serious and well-grounded reasons for believing that this person was in the state of mortal sin then you should definitely encourage him to go to confession. Maybe share your concerns with the priest, without identifying your friend.