Recently I learned about a piece of real life miner’s folklore about creatures known as Knockers. They are also known as Tommyknockers, Bluecaps, Knackers and Kobalds depending on the culture.
These blue, sometimes bioluminescent, impish creatures were said to make rhythmic tapping noises in mineshafts, and occasionally help miners by moving heavy loads of coal to the entrance, among other tasks, if the miners brought them offerings.
To me, this seems like an almost perfect solution to the question of where allays should spawn. If they were to rarely spawn in mineshafts, producing musical tapping noises and flying away from the player until an offering of some kind is made, I think they would be a pleasant surprise for any weary players navigating a mineshaft. This would also add renewed interest in a structure that I feel could use a new feature.