If you dont want to pay someone to change it like NOKIA customer service you can buy a screen on the internet and a digitizer if your digitizer is broken. The price on a Lumia 520 screen is about 50 usd from some websites on the internet.
Some small adjustment can be done by opening the device and try to move it a bit!!! BUT, because the jack is connected to the board via copper by trying to fix it over and over again till it finally get its possition you can cut the jack input. So if you want to try it be carefull and if it can't reach its position dont force it to.
You can try using contact clener spray in to the switch after you take it off your door and if it still does not work then you can order from the internet and change it by yourself. Is not a difficult task to do.
Well the tin foil is a conductor but is not going to fix your problem.Also it's not safe to use tin foil. I would recomend you to order a spare part over the internet and change it. It's easier and safer.