If you want the AdSense script to appear after a particular class or tag then you will probably need to use JavaScript to inject the AdSense script, which could be complicated.
A simpler solution would be add a custom shortcode something like:
add_shortcode('render-adsense', 'render_adsense');
function render_adsense() {
// your function here including the adsense script
}
This way you can manually add the AdSense script wherever you like on the page via the normal page editor.
You can also inject it at a certain point in your template by using the do_shortcode function in a PHP code block.
Documentation on shortcodes: https://codex.wordpress.org/Shortcode_API