I like the basic idea, although I'd swap around numbers and do it this way: have the player roll a d20 and add their PC's level to the result; if this is greater than villain's level, the villain perceives the PC as an immediate threat. Mathematically, there's no difference, but it feels quicker, and more importantly you can let the player make the roll while keeping the villain's actual level a secret. Or, for that matter, keeping a final result a secret; when the ArchLich says "I'll deal with you later," is it really going to deal with you later, or will it deal with you right now, but in a way that maximizes your torture by luring you into a feeling of relief first?
Anyway, Zak made a comment on G+: "(it's a dirty little secret of D&D that if you're just willing to compare two scores and subtract you can do pretty much anything)". And yes, this same comparison could be used a couple other ways:
- PC asking bureaucrat for aid: PC Level + d20 > bureaucrat's level = immediate attention, otherwise d20 result = wait time before bureaucrat even responds.
- Weak Villain, Strong PC: Villain Level + d20 > PC Level = lies about own importance.