The easiest way to do this is to write two <script> blocks.
<script type="text/javascript">
document.write(decodeURI("%3Cscript src='something.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
myFunction();
</script>
When document.write is used, the text is written directly into the document, right after the <script> tag. Because of this, when a browser encounters a <script> tag, it waits for the script to finish loading before continuing down the page. Any document.write that happens in the loaded script might affect the rest of the page (for example, if you do "document.write('<div>')", it will affect the rest of the layout).
So, if you use two <script> tags, the first one is encountered by the browser, and it uses document.write to output a new <script> tag. As soon as that <script> tag is finished, the browser continues down the page, and immediately encounters the new, dynamically added <script> tag. This <script> tag tells the browser to load your external Javascript. The browser will wait to execute the second original <script> tag until this <script> tag has finished loading. Then your function myFunction will be available.
The reason doing it all in one <script> tag doesn't work is because document.write doesn't happen until after the <script> has finished running (myFunction isn't available yet). The reason it works with two <script> tags is because the browser waits until each <script> tag runs in succession, and document.write puts a new <script> tag in line.