How do I reformat this to add php inside php?

As PHP documentation says

Often you’d want to have more than one statement to be executed conditionally. Of course, there’s no need to wrap each statement with an if clause. Instead, you can group several statements into a statement group.

So You have to use curly braces {} to add more statement within if else

<?php if ( $paged < 2 ) {
echo 'some text';
?>
<p>
    Text...
    <?php $published_posts = wp_count_posts('item');
    echo $published_posts->publish; ?>
    text...
    <?php echo do_shortcode("[count]"); ?>
    text.
</p>
<?php
} else {
  echo 'some other text'; 
} ?>