The Doctor, as "James McCrimmon," claims to have studied at the University of Edinburgh under Dr. Bell. Dr. Joseph Bell was a lecturer and expert in observational deduction. He served as a mentor of Arthur Conan Doyle, who used Bell as a model for Sherlock Holmes.
Initially, the Doctor and Rose were both supposed to fake Scottish accents, and then forget to use them when the action started. Billie Piper's terrible Scottish accent put an end to that.
This episode introduces a recurring joke in which the Doctor, aghast at his companions' awful attempts at adopting local accents, quietly hushes them with a "Don't do that." Martha Jones gets the same treatment in The Shakespeare Code (2007) and Doctor Who: The Infinite Quest (2007), while Donna Noble is on the receiving end in The Unicorn and the Wasp (2008) and Midnight (2008), although the latter example is not humorous.
When the Doctor poses as a Scottish physician, David Tennant is actually speaking with his own accent, the first and only time he was able to do that during his time in the role.