I think this is not a very useful function.
For every alias in my script I will have to put a :erro and $error doesn´t give me the file name or the line were the error occurred.

The smartest thing you could do is add an error event, like:
on *:scripterror: {
echo -s Error found: $error
}

This would be usefull for people that have their scripts on the net and when an error occurs the users don´t know what to say because they cleared the text or there mirc closed down, and just say that something went wrong. With this, there could be an erro log created and the user would just send them the file.

smile