How often should one say המקום ינחם וגו’ over the course of multiple shiva visits?
ניחום אבילים is an act of Gemilas Chasadim which has no maximum shiur. Each time one visits he could and should fulfill the mitzvah of Nichum Aveilim. As such the minhag is to say ‘Hamakom’ at the end of each visit. See Shach Y:D 340:51 who is clear that the mitzvah of NIchum Aveilim is not limited to one time during shiva. It is important to note that ultimately the true kiyum of this mitzvah is not merely reciting the Hamakom formulation but rather to speak words of true condolence which comfort and uplift the mourner.