In the Halachot of Boneh (construction on Shabbat), the Poskim discuss whether it is permitted to put back an eyeglass lens that has popped out of its frame on Shabbat. The Shulhan Aruch (318:3) deals with a case in which a leg of a bench fell off on Shabbat. He rules that one may not reinsert the leg, even if done "lightly." The Hachamim were concerned that any type of repair would lead to banging it in a prohibited fashion. Moreover, such a bench becomes Mukse, because of this concern (Rema 308:15).
The Poskim extrapolate from this case to the question of repairing the eyeglasses. The Menuhat Ahaba (Rabbi Moshe Halevi ,Israel, 1961-2001), rules that if the frame has a screw meant to fasten the lens in place, then this would be comparable to the case of the bench. Accordingly, it would be prohibited to pop the lens back out of concern that one may tighten the screw. Hacham Ovadia (Halihot Olam Vol. 4) is also strict in this matter. Nevertheless, in a case where a person needs the glasses to learn Torah, or some other urgent need, he permits inserting it loosely. Hacham Ovadia builds a case to be lenient based on several factors. First, the Hachamim did not enact their Gezerah regarding screws, only regarding banging something in. Second, the Halacha may be that there is no prohibition of construction regarding utensils. In such cases, it would certainly be permitted to instruct a non-Jew to fix the glasses.
The Menuhat Ahaba permits putting the lens back into frames that do not have a screw to hold it in place. Even though, technically, there are means of tightening the lens, such a procedure requires a special apparatus that only opticians have. He relies on the opinion of the Taz (Rabbi David Segal, Poland, 1586-1667) that there is no Gezerah if the only possibility of banging it in tightly is farfetched.
It is prohibited to re-insert a lens into eyeglass frames that have a screw for fastening the lens. In a case of urgent need, one may do so loosely or instruct a non-Jew to do so. If the frame does not have a screw, the lens may be reinserted loosely.