Archibald Douglas, Parson of Douglas — Scottish judge and diplomat