France and England are at war so can England invade Edinburgh in order to capture the key from France?
I'm a little confused because I keep thinking that since the key is in Scotland, I have to declare war with Scotland. But Scotland is listed as "Possible Ally" on the status chart. So am I really attacking Scotland, or France?
You are attacking France. When Scotland is activated as a minor power ally of France, it's not possible to declare war on Scotland (see the 2nd bullet point of Restrictions at All Times, lefthand column of page 14). And as you pointed out, Scotland is a "Possible Ally" of England, meaning it's never possible for England to declare war on them (1st bullet point).
In essence there is no Scotland while they are activated as someone's ally. The major power controls their affairs fully.