Pioneering research by a National Museums of Scotland curator finds statue reflects a village of eminent tomb-makers