As someone who works at LHR, I can help you with this...
Transferring between terminals is not that difficult as long as you prepare yourself in advance. 2hrs should be enough time to connect, although I am not exactly sure of the recommended minimum connection time between T5 and T1.
Assuming your not checking in any luggage and that you will have checked-in online and printed your boarding passes off prior to travelling, you can get off your EDI-LHR flight in T5 and follow the purple Flight Connections signs, where there is a free inter-terminal bus service to all other terminals. It will deposit you at security in Terminal 1.
If you have got luggage checked-in, but do not get a boarding pass for your onward flight, make sure you have a copy of your reservation handy as you can still use the Flight Connections option but sometimes Security can ask to see proof of your onward travel details.
If you are checking luggage, this should be checked all the way through to your final destination so you wont need to collect it in LHR and re-check it in, however if for whatever reason it is not checked-in to your final destination, then you will need to clear immigration in T5, pick up your luggage and then head for the Heathrow Express train and get off at the next stop for Terminal 1. This is also a free service.
Hope this helps, any further questions, please ask away and I'll try to help.