Why did Avraham repeat here what he already appears to have said earlier?
Rashi and Seforno: He is adding here that, even the fifty Tzadikim are unable to save the Resh'im, let them at least save themselves! 1
Ramban: (Following what he wrote above. Refer to 18:23:3:2) - and even if Hashem judges them with Midas ha'Din, it would not be correct to kill the Tzadikim together with the Resha'im, so that people should not say that there is no point in serving Hashem. And how much more so if He tempers Midas ha'Din with Midas Rachamim. 2
See Sifsei Chachamim. The Seforno adds that this Pasuk is a continuation of the previous one, which ends "even if You will destroy the Resha'im and will not forgive them on account of the fifty Tzadikim that are in the town ... ".
Ramban: Which is the Midah of Mishpat, with which Hashem judges the world).
Why does Avraham, both here ("in the midst of the city") and in Pasuk 26, refer exclusively to S'dom?
Rashi, Seforno and Rashbam: Because S'dom was the metropolis 1 (Rashi Pasuk 26) and the king of S'dom chief of the kings (Rashbam).
Ramban #1: (citing the Ibn Ezra): Avraham mentioned "in the midst of the town" because the people feared Hashem in public.
Ramban #2: He mentioned it, because he thought that S'dom might perhaps be worthy of salvation on account of the temporary residents who lived there, such as Lot (and maybe there were others like him).
The Seforno add that Hashem specifically mentioned S'dom because that is where the cream of the crop gathered, and where the righteous people who would rebuke the Resha'im would be most likely to be.
What are the connotations of "Chalilah L'cha ... "?
Rashi: It would be a Chilul Hashem for to kill the Tzadikim together with the Resha'im, since people would point to the generation of the Flood and claim that such is the way of Hashem to wipe out the Tzadikim together with the Resha'im. 1
Moshav Zekenim questions this, for No'ach was the only Tzadik, and he was saved! (See Sifsei Chachamim).
Hy did Avraham repeat "Chalilah Lach?
Why does the Pasuk switch from "Lecha" (masculine) to "Lach" (feminine)?
The word 'Lach' is not feminine. It is identical to the masculine 'Lecha', but the Lamed is given a Kamatz due to the 'stop' called for by the cantillation mark (Zakef Katan) (MK).