Preview:
SpoilerShow

* The green bar in the middle shows the progress; the more accurate you are the fewer attempts are needed to fill the bar and pick the lock.
* If you're not accurate enough the picklock will loose some of it's durability, indicated by the moving icon's color (from green to red). If the durability is zero, the attempt failed
I published a source example here. The picklock is re-usable; consult the readme in the "mod_assets/md_picklock" folder of the example for more info.
The script allows you to register a lock (or door) as pickable. It also adds a "lockpick" item to the game, that can be used to attempt to pick a lock. To pick a lock, the player needs to play the mini-game. The difficulty of the mini-game depends on the difficulty of the lock minus a bonus based on the champion's dexterity. Every player can attempt to pick a lock, but rogues get a bigger bonus, making the unlocking of harder locks considerably easier.
Through scripting you have full control over what happens when a player succeeds or fails; you can just open a door on success, or do whatever you want. And you can punish the player for failing too: break the picklock, shoot fireballs, whatever you put in your callback function.
Credits to Isaac/Gizmojunk for the model and textures of the picklock item.
Please give me your thoughts and suggestions to improve it, or leave a message if you (plan to) use it in one of your mods.