What i would like is that the script is run when the player enters the lockpick minigame, "Begin menumode If menumode==1014", but if it isn't possible to get the reference of the object player used, that won't work.
I played around with it using the console and to do that, this script should work attached to a quest with a short delay:
ref rObjectshort sWaitingBegin GameModeIf sWaiting == 1Set sWaiting to 0endifEndBegin MenuMode 1014If sWaiting == 0 ;prevents the script from running more than once per sequenceSet sWaiting to 1Set rObject to GetCrossHairRef;Do whatever you want to the objectendifEnd
The bad news is I'm pretty sure that once you enter the minigame, the lock level is set. Even if you change it while in menumode 1014, it won't update until you leave the minigame. I just tested this out using the console, so maybe a script that runs immediately when the minigame opens would work...