Well, what's the point of putting hl to 0 prior to loop and then using it as a counter like I use the acc. instead?
There's none, it's just a piece of code to optimize. If you want my opinion, this routine could be replaced by "ret" and it would output the same, but it seems we have to care about whatever the routine does.