In Visual Studio 2010, under Tools -> Options -> Text Editor -> HTML -> Formatting -> Tag Specific Options, there are options for configuring how the editor auto formats differe
Well, there's Edit -> Advanced -> Format Document, which I guess messes your code up as well. I searched loads of documentation trying to find something more, but as far as I can say, there isn't anything.
Edit:
The Problem isn't in the HTML Formatting options but with the <% %> "tag". For example:
works quite well. As I said, I don't think this can be done.
For the moment I recommend using:
<%="Hello World" %>
or
<%
if(true)
Response.Write("Hello World");
%>