Well, oops. I just wrote it up real quick, it'll give you an idea of how to do it anyways.
I've never actually used nvault in one of my plugins

.
I'm pretty sure I'm using nvault_lookup improperly, I don't know for sure though. I'll look at again later and try testing it.