You can place this code in your content page, rather than your master page.
Then in code behind, for instance in the content page's Page_Load event handler, you can add this:
ScriptManager1.RegisterStartupScript(
Me,TypeOf(Page),"startupScript","Sys.Application.add_load(page_Load);",True)
where ScriptManager1 is your script manager. This should run your script on both partial and full page postbacks.
If your script manager is in your Master Page, then you can access the master page like this (assuming that your Master Page is called MasterPage1):
Dim myMasterPage As MasterPage1 = CType(Me.Parent, MasterPage1)
Dim myScriptManager As ScriptManager = myMaster.FindControl("ScriptManager1"), Microsoft.Web.UI.ScriptManager)
myScriptManager.RegisterStartupScript( ...)
(I'm coding from memory, btw, so apologies if it isn't completely right).
James