How to discourage irrelevant self-citation?
Did I do the right thing to discourage this practice of irrelevant self-citation?


Yes. In fact, as a reviewer, you should point out irrelevant citations of any kind (self- or otherwise), and suggest that these be removed. Conversely, you should not complain about relevant and appropriate self-citations. The issue is the lack of relevance, not the self-citing.


  Is there anything else that I should have done?


This is exactly what should happen: reviewers should call out this kind of thing, so the authors will have to remove the irrelevant citations before the paper is published. This anecdote is a triumph of diligent reviewing :)