As Garth say, you need to sit down and analyze the problem and check the requirements.
It seems to me that you try to use the same procedure for both inserting a new person and also to update an existing person.
If my assumption is correct, I think this is a mistake. It is better to separate the two functionalities into two different procedures for a cleaner logic.
Insert
The first thing you need to do in this case is to count how many persons that already exists with the same first and last name. That will give you the an index for this person.
The problem occurs if a person in this set has been deleted, then you will have two persons with the same index.
John Doe1, John Doe2, John Doe4.
NewIndex = Count + 1 = 4 = trouble
So you need to have an algorithm that takes care of this case too.
Update
When you update there is no way you can select the right person from the set John Doe1, John Doe2 and John Doe3 automatically.
What you need to do, as Garth said, in the case of multiple names, is first to present the admin with a list of the names and as much relevant information as possible, including the primary key of the table.
Then the admin can select the person to update and the stored procedure is called with the primary key and you will always be sure that the correct person is updated.
(Provided the admin picks the right one, of course)
[UPDATE]
OK, so your problem is when you are updating a person and the first name and the last name has changed and all of a sudden you a yet another person with the same name.
What you need to do now is to take a deep breath and go through the different scenarios. One key here, pun intended, is that you do provide the primary key as a parameter into the stored procedure.
Now you have to consider the different cases:
1. Neither the first name nor the last name has been updated.
No problem, update as normal.
2. Either the first name or the last name has been updated or both.
Check if the new combination of names exist in the database.
If not: No problem
If so: Assign a new index number for this person. Use the same algorithm as for the insert SP.
I hope this will help you forward.
I just came from the pub and about to go to sleep, so maybe, just maybe, I am not at my brightest right now.