If you are flying BA to Edinburgh on the same ticket as your transatlantic, you can use the LHR T1 Terraces lounge before your flight but definitely clear immigration and customs in your arrival terminal, T3 and use the AA Arrivals Lounge if you want to shower and have a bite of breakfast- it is less used than BA's Terraces so probably no wait for a shower. You should leave the Arrivals Lounge a good 90 minutes before the departure of your Edinburgh flight, to get to the other terminal and clear security.
If you are flying BA and are Platinum or EXP, you could use the Edinburgh Terraces Lounge before your flight back to LHR.
Have a nice trip!