You could use GetWebResourceUrl() to get the path string to your embeded script as it should be in the page (probably something like websresource.axd?XXXX). Then manually insert a script tag pointing to the path using RegisterStartupScript to force it to be added at the end of the page. Something like below...
path = ScriptManager.GetWebResourceUrl(this.GetType(), "Fucntion.js");
ScriptManger.RegisterStartupScript(this.GetType(), "MyScript", "<script type=\"text/javascript\" src=\"" + path + "\"/>");
From the server you could also try adding your script later in the load process for example in the prerender event. Or from the client side can wrap your script into a load so that it doesn't run the code until the last possible moment as below...
function RunOnLoad()
{
button.onclick = function()
{
alert("Clicked!");
}
}
window.onload = RunOnLoad;