'alias' is the keyword to define an alias, it can be a block of code as you've said or it can be a single line. 'safe' is the name of the alias. 'return' is a command which returns a value when you call the alias. If I had an alias "alias pi return 3.14", then $pi would be replaced by 3.14 whenever it was used.
The usage of $safe is only necessary because of the behavior of timers. Timers will evaluate identifiers inside of them. What the safe alias does is encapsulate the text in $decode so that $decode is evaluated instead of the original contents.
You can see the behavior of safe in the following aliases. First, I store the text "$time" inside of $1-. You can see that in /a when the timer ends $time is actually evaluated and the current time is printed. In /b when the timer ends you see the literal text "$time" is printed.
alias a {
tokenize 32 $!time
echo -ag input is: $1-
write -c test.txt $1-
echo -ag result of $!read: $read(test.txt,1)
.timer 1 0 echo -ag result of timer: $1-
.remove test.txt
}
alias b {
tokenize 32 $!time
echo -ag input is: $1-
write -c test.txt $1-
echo -ag result of $!read: $read(test.txt,n,1)
.timer 1 0 echo -ag result of timer: $safe($1-)
.remove test.txt
}