There was no way any exchange would have occured while Franco was in power. Britain needed a naval base in Gibraltar during World War 2. There is no way Attlee would have done a deal afterwards with Franco. The base was important for Nato so it would have remained. Hitler offered Franco Spain in return for support but Franco was more astute than Mussolini and realised the outcome of the war wasn't obvious in 1940. Franco was a survivor and it is only recently that the extent of his crimes are being acknowledged in Spain
Well, it is clear that recovering Gibraltar in exchange of Morocco does not seem very good idea. It doesn´t get many followers.
About Franco: Andrew, I think that you overestimate him. In fact, Spain was so close to entering the WWII. Franco, in fact, was very keen to enter. The negotiations, however, not succeeded. Personally,I think that Germany saw Spain more like a burden than a help and I think that they could be right, but this is only my perception