In order to not delete help from all other screens, you need to always return the contextual help text, otherwise your filter doesn’t return anything for non-page/post screens and so nothing will show up. Move the return to the bottom of the function, outside of your if/else. Also, the original contextual help is being concatenated to the end of your custom message, so move it to the front to have your text put at the bottom. Thus:
function myprefix_page_help($contextual_help, $screen_id, $screen) {
if ($screen_id == 'page') {
$contextual_help = $contextual_help.'
<h5>Shortcodes</h5>
<p>Shortcodes help</p>';
}
elseif ($screen_id == 'post') {
$contextual_help = $contextual_help.'
<h5>Post help</h5>
<p>Help is on its way!</p>';
}
return $contextual_help;
}
add_filter('contextual_help', 'myprefix_page_help', 10, 3);