Mostly depends on how you have the columns in your "people" (for lack of a better name) table defined. If none of the columns are required, you can insert a row in the database with just the last name populated and retrieve the row for display just as if the last name were already in the list.
The trick is not so much an issue of SQL programming, but of letting your proggy know when to do the insert. Especially since you don't want specific input from the user (an "add new" button") to trigger the event.
You seem to have logic there already to try to retrieve a row from the database when the user clicks on a name in the list. Since the "new" name won't be in the list, the user can't click on the name there to fire the query.
You could add logic to the onclick event of the name entry box to check for the length of the contents of the entry box and, if not zero, query the DB for the name and insert a row, retrieve it, and display the results (just a last name and all the other bozes empty.
Thing is, the logic for the onclick event in this case would be the same as the onclick event for an "add new" button. Either way, the user needs to do SOMETHING to trigger the insert. It would be more intuitive for the user to have an "add new" button available to click on.
Then you have the issue of the logic needed to trigger updating the row in the database with whatever the user enters in the "empty" boxes. The user needs some means to let you know that the entries are ready to be committed to the database. Either an "update" button (more intuitive on the user's part) or logic that commits the data entered when the user starts keying something else in the query box or goes somewhere else. If you try to do this automagically in the background, you'll need some mechanism for the user to indicate that the entries made to the "empty" record may need to be discarded instead of committed to the database.
Using buttons for let the user indicate what action (add, update, ignore) is wanted is a lot more user-friendly than trying to programmatically second-guess the user. And it puts you quite a bit closer to knowing that the data being saved in the database is valid.