Refer to the scenarios below.

In scenario A, the inline script will get appended to the page, then it will be replaced with the equivalent script, resulting in execution. Then the markup will be appended to the page. In this scenario the order between scripts and markup are exactly the same as in its static equivalent.

In scenario B, the outer div will be appended to the page including all the markup and inline script (which doesn't get executed in all browsers). Then the inline script will be replaced with its equivalent script, resulting in execution. The script's position remains correct relative to the markup. The only difference from this scenario's static equivalent is that the bottom markup appears before the script is executed. The only potential problem that I can think of is if the embedded inline script assumes that the bottom markup is not yet on the page and inadvertently ends up manipulating it. Scripts should not be written in this manner, and even if it is at least it's limited to the corresponding mojit.

The only alternative solution I see is recreating and appending each element of the tree individually (a more verbose and expensive solution)...

Scenario A:
```html
<script>Inline Script</script>
<div>Markup</div>
```

Scenario B:
```html
<div>
    Markup
    <script>Inline Script</script>
    Markup
</div>
```