Hi, @LexanRed.
I had previously suggested something with a similar purpose:
https://developer.nuki.io/t/option-to-allow-disallow-users-to-unlock-the-smart-lock/
https://developer.nuki.io/t/who-what-locked-unlocked-the-smart-lock/
Does it sound like what you want to achieve?
Of course, it implies that every code either only locks, only unlocks, or performs both actions.