One simple thing that should be done is IDEA should emit a matching %> tag whenever you type <% similar to when you type <html>.
If we have JSP code style settings I want (see IDEA-6496), then IDEA could also automatically format and position the cursor also.
So, if I type
I should see
This will help out on the poor auto-indenter because it gets really confused if you don't have a matching %> tag.
Related Request:
JSP: Global Code Style Settings needs a JSP tab for JSP-specific constructs like <%! %> and <% %> blocks
http://www.jetbrains.net/jira/browse/IDEA-6496