We initially had thoughts along the same line - however in retrospect we're glad we didn't. As it turns out, over time it is possible our organization would use the same search code (which is our LAN log-in ID). We now use the Person Source ID which is keyed to a unique employee number in or organization (and is used for automated data exchange purposes)as a unique ID. Also, in setting Search Code standards, we now need to consider external people with the same names.
All to say, your situation may be different but think carefully on trying to implement unique Search Codes for people (which can't be set as a unique field in Service Desk). Likely the best you could do is create an overview action if the Search Code already exists.
We have been facing with same problem regarding search code for person due to the fact that this field is not unique in SD. The simpliest way is to choose a naming convention for a search code, taking the first 4 letters from first name and first letter from last name for example. If you have more than than one person with same name (John Doe) your search codes will be: JOHND1, JOHND2, and so on. When you have to record a new person, just search for string JOHND and add the next digit if is necessary. This method works fine, especially for those people which are working in your organization but don't have an employee ID(service providers, consultans, etc). Hope this helps you somehow.
I've been trying to do exactly the same thing and came to the conclusion that I can't make Search code unique, so, I went for a solution to highlight the fact that the Search code being used was already in use.
This means its down to the operator to use a different Search code rather than forcing uniqueness through the system.
Anyway, see this thread which shows how to create a rule which is triggered when a new Person form is used and and the Search code field is changed, (i.e. somebody types in a Search code). The rule then kicks off a Smart Action which picks up that Search code and shows a list of records, (if any) that already have that Search code.
At this point the operator would know the Search code is in use (if a record is listed) and use a different Search code.
I can post screen shots of the final results if you would like, (UI rule and Smart Action).