If i get it right, then you just need to get that value from post meta, and make condition.
$image_or_video = get_post_meta($post_id, $prefix . 'image_or_video', true);
// Option 2 is selected
if( 'custom' === $image_or_video ){
//Then execute some PHP code
}