After reading your question, it seems you have things a little mixed up... please excuse me if i have misinterpreted and you already know this stuff.
Can we straighten out the terminology you are using? I assume you mean to say:
How can i [attach | insert] a piece of javascript into the page when the grid ItemDataBound event fires?
If this is what you mean, then skip to the following paragraph. If it isn't and you were expecting the javascript to be executed immediately, then it can't: you are on the server, javascript runs on the client.
With your test start up script, it also will not run when it is loaded as part of an ajax callback - your page has already loaded, all you are doing is replacing part of it.
When injecting scripts in the ItemDataBound event, the normal thing to do is to attach a piece of script to an event of an HTML element - you could just inject a piece of script in to the page, but you will inject it for every item that is databound (unless you test for its presence first), and even then it is useless unless you either directly call it or have something trigger it.
Here is a good example to get you started, there is a load more out there which you can find with a quick google.