I believe this could be done only after the HTML is rendered. The reason behind this is the Razor is mainly used for rendering the HTML. The Javascript could be run upon for a HTML element only its is completely rendered. If I understood your question, you want to dynamically assign the URL which is rendered by the javascript function to the data_autocomplete property of the textbox. I would suggest you the method below
var currentURL = @Url.Action("SomeAction","SomeController");
var parameters = YourJSMethodToreturnTheParameterValue();
$("#SomeProperty").attr("data_autocomplete",currentURL+'?someParameter='+parameters;
Ideally, the TextBoxFor would render the Property name as its ID.