I've replaced the glass in my 748 headlight (same as 998) by getting hold of a headlight that had broken on the other side
The glass is sealed into the plastic unit by some kind of sealant. I used a sharp knife to cut round this and pull the (broken pieces of) glass out of the plastic. Once all the glass is out you can clean up the sealant off the plastic.
Make sure your new glass is clean (use brake cleaner) along with the plastic housing. I then used some silicon window sealant (in black, fiver from B&Q) and put a good dosage all the way round the plastic like glue. Push the glass into this and then add more sealant around the edge and shape it down with an appropriate tool (ie, wet finger).
Leave the end cap/bulb holder off and leave it to cure for as long as possible. You may find it helpful to put it glass down and then weight something on top to keep it under pressure and ensure a good seal.
Mine has been good for a couple of years now, without any problems.
I've been told by a mate that owns a plastics firm that the milky film on the inside of the glass is caused by the plastic "venting" gas, a natural chemical reaction. As the unit is sealed, there is nowhere for it to go so it sticks to the only other material - the glass - and forms this coating.
To get rid of it, you can remove your headlight unit and take out the bulb and lens holder to gain access to the inside of the glass. Then you can wipe the inside with a cloth (lint free is best!) or just spray in some brake cleaner or glass cleaner and wipe it out.
Again, I had the same milky problem when I first replaced my glass due to the gas venting (which is why I recommend you leave the cap/bulb off to help the gas escape) but it was easily cleaned and hasn't returned since.
Hope this helps.