I still don't think the particular content of his message is necessarily something I would consider inappropriate. To put it in context, imagine if one female friend sent that same message to another female friend. Heck, even though guys usually aren't that open with their feelings and emotions, imagine one male friend sent it to another male friend as well. In either of those cases, you wouldn't think "Woah! He/she is secretly in love with this friend." You'd just think "Hey, that was a really nice, sweet message." I suppose he could have specifically used the word friend such as saying "You are a really special person to me and a great friend...." But, from what you shared of the message, I don't think the content in an of itself was inappropriate from one friend to another regardless of the gender.
HOWEVER....
I do think there are a few ways in which it did somewhat cross the boundaries of what is appropriate in this specific situation. For example, the fact that it is almost exactly word for word a message he has sent to you as somebody he liked as more than a friend, that does make it seem a bit inappropriate. Also, considering the fact that he once had feelings for her, that makes it a bit inappropriate. So, yeah, I'd agree in this case that he did kind of cross the boundaries a bit. Did he realize that and/or intend it? Maybe, maybe not. It does at least sound like he legitimately feels bad that he upset you. He could be sincere in that, or he may not be sincere at all. Time will tell for sure. For now, it seems like he legitimately is trying to learn the appropriate balance to make all parties happy. If he continues to sincerely make the effort, then perhaps you give him the benefit of the doubt.... within reason that is. First off, "sincerity" can often be easy to fake, but never for long. So, if he proves not to be quite so sincere after all, you certainly don't want to put up with that. Secondly, even if he does make a sincere effort, if it seems like he cannot find a balance that makes him happy without upsetting you, then perhaps that is not enough. After all, the road to Hell was paved with good intentions, as they say. Good luck to you. I hope it goes well.
EDIT: Jester being a nerd in a sort of related, sort of unrelated separate thought....
P.S.
How much of a nerd does it make me that, in my head, I was kind of equating this to a situation in Spider-Man 3? LOL! It made me think of the scene where Peter, as Spider-Man, does the upside-down kiss with Gwen Stacy for the photo shoot, not even thinking how that would hurt MJ's feelings since it was an exact copy of a special moment they shared. "Spider-Man" and Gwen kissing would MAYBE be somewhat forgivable if truly just done for the crowd. What made it wrong was a) the fact that it was a special moment Peter and MJ had (albeit before she knew he was Spider-Man) and b) it wasn't just a kiss with some random girl he rescued, it was a girl in his school with whom he was very friendly.