Insert text at specific position in Google Docs
<p>Trying to insert text to a Google Doc. I would like it to be formated as followed:</p>

<p><a href="https://i.stack.imgur.com/ZH9Bn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZH9Bn.png" alt="enter image description here"></a></p>

<p>Text1</p>

<p><em>Space</em></p>

<p>Text2</p>

<p><em>Space</em></p>

<p>I have the following code:</p>

<pre><code>function InsertText1() {
   var body = DocumentApp.getActiveDocument().getBody();
   var text = body.editAsText();
   text.insertText(1, 'This is ju for test, lorem ipsum!');         

}

function InsertText2(){
   var body = DocumentApp.getActiveDocument().getBody();
   var text = body.editAsText();
   text.insertText(10, 'What test?, lorem ipsum!'); 
}
</code></pre>

<p>The results from running this, gives us text-in-text and just a mess. 
<a href="https://i.stack.imgur.com/q3DHX.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/q3DHX.gif" alt="enter image description here"></a></p>