What you are talking about here is perfectly feasible and planned for the future. If it isn't already in http://bugs.moodle.com then please log a new feature request there. The future comes even faster if people send me code along with their requests.
In the meantime, the enrolment key system need not be open to abuse. If you think the key is being abused, just unenrol the offending student and change the key.
(By the way, this is not the best forum for feature requests...)