// check that there is no potential for an infinte loop
$result = db_query("SELECT * FROM {url_alias} u WHERE src = '%s' AND dst = '%s'", $form_values['redirect'], $form_values['path']);
if(db_fetch_object($result)){
form_set_error('path', t('The path you have created already exists as a URL alias, which will cause the site to loop back and forth between the two indefinitely.'));