How to inject code into node body after x paragraph
Well, one way to do this would be to modify the twig template that is outputting the paragraphs (on the node).

You could loop the paragraphs render array {{ content.field_foo }}:

{% for i in content.field_foo %}
  {{ content.field_foo[i] }}

  {% if i == 1 %}
    // print your output
  {% endif %}
{% endfor %}


1 will be your second item, as the count starts at 0. This is just some rough untested pseudocode. But the idea is to loop over and print each item in the render array one by one, and inject the code at certain counts.

edit: This answer is for if you are using the Paragraphs module, which at the time of this answer is not clear from your original question.