Based on the context (i.e. the passages immediately before and after) it's pretty clear the only discussion is with regard to a therapeutic application, not a cosmetic one:
אמר רב זוטרא בר טוביה אמר רב: עין שמרדה מותר לכוחלה בשבת. סבור מיניה: הני מילי הוא דשחקי סמנין מאתמול אבל משחק בשבת ואתויי דרך רשות הרבים לא. א"ל ההוא מרבנן ורבי יעקב שמיה: לדידי מיפרשא מיני' דרב יהודה: אפילו .מישחק בשבת ואתויי דרך רשות הרבים מותר. רב יהודה שרא למיכחל עינא בשבת. אמר להו רב שמואל בר יהודה: מאן ציית ליהודה מחיל שבי! לסוף חש בעיניה. שלח ליה: שרי או אסיר? שלח ליה: לכ"ע שרי לדידך אסיר. וכי מדידי הוא?! דמר שמואל היא - ההיא אמתא דהואי בי מר שמואל דקדחא לה עינא בשבתא צווחא וליכא דאשגח בה, פקעא עינא. למחר נפק מר שמואל ודרש: עין שמרדה מותר לכוחלה בשבת. מאי טעמא? דשורייני דעינא באובנתא דליבא תלו
Rav Zutra bar Toviyya says [that] Rav says: With regard to an eye that is marda, it is permitted to apply kohl to it on Shabbat. The Sages initially thought that [this ruling] applies only where one had already ground the ingredients yesterday, [i.e., before Sabbath], but it would not be permitted to grind them on Shabbat, or to bring them through a public domain, [as this would constitute a desecration of Shabbat by Torah law]. [To dispel this notion], one of the Sages, named Rabbi Ya’akov, said to them: This matter was explained to me by Rav Yehuda, who said that even if he plans to grind the ingredients on Shabbat and bring it through a public domain, it is permitted. [Accordingly], the Gemara relates that Rav Yehuda permitted application of kohl to the eye on Shabbat. Rav Shmuel bar Yehuda said to the Sages: One who adheres to the ruling of Yehuda desecrates Shabbat. Ultimately, Rav Shmuel bar Yehuda [himself] suffered pain in his eye. He sent a message to Rav Yehuda, asking: Is it permitted or prohibited for me to treat my eye on Shabbat? Rav Yehuda sent back to him: For everyone else, it is permitted; for you, it is prohibited. Was it of my own accord [that I issued this
ruling]? It is [the ruling] of Mar Shmuel, [as demonstrated in the following incident]: There was a certain maidservant who was in the house of Mar Shmuel whose eye became infected on Shabbat. She screamed in pain, but there was no one who attended to her. Eventually, her eye burst (paka). The next day, Mar Shmuel went out and taught: With regard to an eye that rebelled, it is permitted to apply kohl to it on Shabbat. What is the reason for this [leniency seeing as one may desecrate Shabbat only to treat life-threatening afflictions?] The reason is that the tendons [shuraynei] of the eye are connected to the valves of the heart.
See also Mahmood et al, Kohl Use in Antiquity:
Ancient civilizations used a vast number of natural substances in ophthalmic preparations. These preparations were not only used to treat and prevent eye disease, but were also applied to protect the eyes from harsh physicochemical environmental conditions as well as for cosmetic purposes. One such preparation was given the name kohl, the main constituent of which is lead sulfide, commonly known as galena. Kohl may contain certain herbs and natural substances in an ultrafine powder for application to the eyes... Recent findings suggest that Egyptian eye preparations in the form of kohl led to increases in the production of nitric oxide, a chemical substance with antimicrobial properties. Nitric oxide has also been reported to be an important regulator of ocular blood flow, which is involved in controlling basal blood flow in the choroid, the optic nerve, and the retina.
With regard to why the ruling might be different for Rav Shmuel bar Yehuda, see Rav Nachum Rabinovitch, z"l, Siach Nachum YD 89 p. 298 where he rules that certain low level risks can be subjectively decided with regard to overriding Shabbos, i.e. based on an individual's personal assessment of acceptable risk to life. Perhaps, since Rav Shmuel bar Yehuda revealed that the risk was acceptable to him, he no longer had the right to override Shabbos. For everyone else, we view the risk as unacceptable and Shabbos is overridden.
(Notably, Rav Rabinovitch is not discussing a case where there is an overwhelming medical consensus that a risk is unacceptable; where there could arise a desecration of G-d's name by ignoring the risk; nor where the risk is to a large population.)