The first one takes the first 5 tokens ($fulldate = Thu Dec 13 22:22:22 2018) and converts it to $ctime and then compares it to the current $ctime, which gives you the number of seconds that have elapsed since the event was added.
See what this gives you if you add it above the if:
echo -st * FULLDATE: $1-5 CTIME: $ctime($1-5) CURRENT CTIME: $ctime
It doesn't add spaces when adding channels, it separates them with a comma, so you'll get: #channel1,#channel2,#channel3... which counts as a single token.
EDIT:
To add to the first one: it checks if the entry is less than 10 seconds old. If it's over 9 seconds, it adds a new line.
You can change it to anything you want, or even remove it. It'll just keep adding to the same line as long as the targets are the same.