The Shu”t Maharil (end of 145) answers: The Maseches Sofrim is following the opinion of the Yerushalmi (Berachos 9:13) who learns that we recite berachos whilst doing the mitzvah (בשעת עשייתן), and not like the Bavli who learns that we recite berachos before doing the mitzvah (עובר לעשייתן). According to the Maharil, the Maseches Sofrim is saying: First one begins to light the menorah, then he recites a berachah “lehadlik ner shel Chanukah”, then he warns his household members “haneiros halolu kodesh hem etc.” and then he continues to recite the other two berachos (on the first night).
However, many poskim argue on the Maharil. Therefore, the Kneses HaGedolah (Hago’as on the Tur 676) writes: First one recites the berachah of “lehadlik ner shel Chanukah” before lighting, which is enough to be considered reciting the berachos before the mitzvah, then he recites “haneiros halolu” and the other berachos. The Kneses HaGedolah doesn’t want to say the Maseches Sofrim is following the Yerushalmi which we don’t go like. This is also how the Terumas HaDeshen took on (see Leket Yosher pg. 152). The Achronim argue over the opinion of the Tur, and whether he holds like the Maseches Sofrim (see Bach 676) and one should recite “haneiros halolu” after the first berachah, or if he holds that one should finish reciting all the berachos first.
Source for Reciting “Haneiros Halolu” in Shul
The Leket Yosher (pg. 151, in the new version pg. 340) writes: “One who lights candles in shul needs to recite “haneiros halolu”, however, one who merely helps doesn’t”. The above is also clear from the Mekor Chaim (671:7).
The Rema (671:7) writes in the name of the Maharil, that if the chazon is in a rush to start davening, after he makes the berachos and lights one candle, a gabbah can light the rest and the chazon can start davening. The Mishnah Berurah (s.k. 48) writes: This should only be done if there is a big need, otherwise it’s best for the one who started the mitzvah to finish it off.
The Siddur Ya’avatz is bothered, why the chazon needs to rush to start davening, and why he doesn’t wait until he himself finishes lighting all the candles. Since he merited to start the mitzvah, he should finish it off as well. And if one person lights the candles and another person starts davening before the lighting of the menorah is finished, it’s not good.
Reciting “Haneiros Halolu” After Lighting the First Candle, or After Lighting All the Candles
If the tzibbur [congregation] is waiting for the chazon to finish lighting before starting Ma’ariv, is it ok to start reciting “haneiros halolu” after lighting one candle to avoid tircha detzibbur [keeping the congregation waiting]? Or should it still only be recited at the end and the tzibbur should simply wait?
The Mishnah Berurah (676:8) cites the Shu”t Maharshal who writes: Immediately after lighting the first candle which is the main one, one should recite “haneiros halolu” and finish off lighting the rest of the candles whilst saying “haneiros halolu”. However, he concludes in the name of the Pri Megodim, that one who has the minhag to say “haneiros halolu” after lighting all the candles is also doing correctly.
However, the Pri Megodim (Mishbetzois Zahav s.k. 5) writes much more than this. He says : Since the berachah is going on all the candles, how could it possibly be that one should interrupt in the middle of lighting? He ends off, chas vesholam I am not coming to argue on the מאורן של ישראל המהרש"ל ז"ל – the Maharshal who brought light to Klal Yisroel, however, one who has the minhag and recites “haneiros halolu” after lighting all the candles is acting correctly.
In another place, the Pri Megodim (Eishel Avraham 672:3) writes: Ideally one should recite “haneiros halolu” after lighting all the candles, as why should one interrupt in the middle. However, he then brings the Maharshal and writes tzorich iyun [the manner needs more looking into]. The Mekor Chaim (siman 676) and the Siddur Ya’avatz both write that one should recite “haneiros halolu” after lighting all the candles. This was also the minhag of the Steipler (see Orchos Rabbeinu Vol. 3 pg. 21).
Conclusion
Based on all the above, it would seem, that if the one lighting the shul menorah is accustomed to reciting “haneiros halolu” after lighting all the candles, then when lighting in shul he should act this way as well. And, although the tzibbur will have to wait for Ma’ariv to start, he should still only recite it at the end. If, however, one is accustomed to reciting “haneiros halolu” after lighting just one candle, then he should act accordingly in shul as well.
In some shuls the same person lights every night, if, however, the shul chooses a different person every night, then perhaps they should try and choose someone who has the minhag to recite “haneiros halolu” after lighting the first candle.
(The above write-up is based on a Teshuvah written by R’ Yom Tov Sanger)