There are times when an anonymous, self-executing function is useful for event handlers. Your scenario is not one of them.
Here's one example. In this example, I'm using a scoped variable to keep track of how many times the handler is invoked, but in order to keep that variable from leaking into the outer scope, it has to be in a function; but in order to persist the value across event handler calls, it can't be initialized in the handler itself-- it needs to be bound in a closure.
a.onclick = (function () {
var counter = 0;
return function (e) {
++counter;
alert("Hi! This handler has been invoked " + counter + " times!");
};
}());
So the self-executing function itself returns a function which is suitable as an onclick handler. However, it also has its own static state that it needs to keep track of even between invocations.
This is just one example of why it might be useful to use a self-executing function that returns a function for an event handler or other callback slot.