The real statement is found in only one version of the Vilna Gaon's letter to his family while he was attempting to move to Israel. He wrote:
ותבלין שלו לזכרים עסק התורה ולנקבות הצניעותThe Vilna Gaon was speaking in terms of one specific aspect. The Gemara (Kiddushin 30b) quotes God as speaking to the Jews and saying that He created the evil inclination but created Torah as its antidote. Rashi (Bava Basra 16a sv. Torah) explains that the study of Torah ends thoughts of sinning. The Vilna Gaon states that just like being involved in the study of Torah cancels out the power of the evil inclination in men, being involved in modest behavior does the same for women.
The antidote [to the evil inclination] is involvement in Torah for men and for women, modesty
This is a much more limited concept than one might have otherwise thought.
(On this, see R. Betzalel Landau, Ha-Ga'on He-Chasid Mi-Vilna ch. 15 n. 21; R. Pesach Eliyahu Falk, Modesty - An Adornment for Life, p. 38.)