That is the light proximity sensor. The other piece is the clip that holds the sensor in place. You need to make sure the sensor is pushed in all the way and then lock the clip into place. This should not have effected your LCD from not turning on at all. Check your connections after you have properly put the sensor back into place.
I've changed just the keyboard several times. As long as there are screws you are gold. If its riveted in you are better off with a new upper case. I would also recommend buying a keyboard that comes with the keyboard backlight as it is possible you will rip it trying to pull the original backlight up. I would say this is a very difficult repair. You are going to have to completely disassemble the computer to do this. Good Luck!