The Unofficial Patch pulls you out of sneak when mining as of version 1.3.0.
- MineOreScript has been fixed to prevent sneaking from becoming messed up as well as preventing respawned ore veins from becoming unmineable. (Bug #281, Bug #12000)
If you have an overriding script, it might not have carried over the fix but it would be pretty easy to carry forward. Though I don't know if it will help NPCs detect you, at least not if they are in a different room or out of line of sight.
Edited by Wormheart, 24 January 2015 - 01:36 PM.