Suggestion: When you post code, surround your code with UBBCode code tags:
alias aliasname {
var %i = 1
inc %i
echo -a I: %i
}
This will prevent the server from losing your indentation as well as from interpretting anything inside the code as something it should interpret, like a smiley or a tongue.