This would be most simple functional question in Drupal 7.
Now below mentioned things are mandatory to do and cant change the functionality.
1) I have created a custom block in module.
2) I have included form like below:-

function usercontent_block_view($delta='')
{

$block = array();
switch($delta)
{
case 'user_front_page' :
$block['content'] = drupal_get_form('genre_all_login');
break;
}
return $block;
}
3) Now I have some other content in block but which put me in trouble is shown below:-

function genre_all_login($form) {
$form['new_user'] = array(
'#type' => 'item',
'#markup' => l('Add New User','http://www.google.com'),
);
return $form;
}

4) So it includes a link which will move me to Google once clicked.
5) Now I want to validate certain content inside the block before user navigates to Google.So if the condition doesn't match then I will stop the user by showing an error message and hence user cannot traverse to Google.

Please tell me if it is possible or should I use different technique to handle this scenario.