no, the code isn't right I just needed some info so I can help make it right.
In the functions.php file you don't need <?php ?> so just use
PHP Code:
remove_action( 'genesis_post_title', 'genesis_do_post_title' );
add_action( 'genesis_post_title', 'child_customtitle' );
function child_customtitle() {
if ( is_single() && in_category( 'portfolio' ) )
echo '<h1>Portfolio</h1>';
elseif ( is_single() && in_category( 'blog' ) )
echo '<h1>Blog</h1>';
else
genesis_do_post_title();
}