Isn't information inputted in a meta box also available as a custom-field? At least it is the way I do it. If you show the custom fields you should see the id with value. I don't see whats wrong with:
PHP Code:
function affiliate_hide() {
global $wp_query;
$my_meta = get_post_meta($post->ID,'_my_meta',TRUE);
if( isset( $my_meta['link'] )) {
$target = $my_meta['link'];
if($target == '') {
wp_redirect(get_option('siteurl')); exit; // if no blog post redirects to index page.
}
wp_redirect($target, 301);
exit;
}
}