Script waits for vertex to be selected

Hi,

I was wondering how I could achieve the following:

if one (and only one) vertex is selected, the script should continue, otherwise it should ask inform the user (by a non-modal dialog box) to select one vertex. As soon as this vertix has been selected, the script should continue.

Any help apreciated.
Regards,
BlackNo666