Add a div of content within the_content after a certain block

Yes, add_filter() is what you’re looking for, but to identify a specific block, you want the render_block hook.

<?php
add_filter('render_block', function($block_content, $block) {
    // Only for Core Code blocks
    if('core/code' === $block['blockName']) {
        // Add your custom HTML after the block
        $block_content = $block_content . '<div>Test addition</div>';
    }
    // Always return the content
    return $block_content;
}, 10, 2);
?>

Anywhere the code block is rendered (which would currently be the front end of a Page, Post, or CPT, but in the future could be elsewhere) your added code will appear.