In case anyone else comes across this issue again, I solved the problem, very simple!
All it needed was
Response.End()
At the end!
So the full function becomes:
Sub Download() Handles button.click
var AllTheScript as string ="blah blah blah"
Response.Buffer = True
Response.Clear()
Response.ClearContent()
Response.Write(AllTheScript)
Response.ContentType = "application/text"
Response.AddHeader("content-disposition", "attachment; filename=myJavascript.js")
Response.Flush()
Response.End() '///<<< Final Line Essential!
End Sub