Having just read "Easy to Love, Difficult to Discipline", I would work on teaching my child assertive communication skills to help her stand up for herself. If my child came to me crying about a situation like this, I would go with him/her and coach her to tell the other child firmly, "I don't like it when you say that to me." If I thought I could discern what the other child was really trying to communicate (because I agree that "you're not my friend" is just 4-year-old code for something more complex that they can't articulate), then I would coach that child as to what to say to express what he wanted to get across in an appropriate manner. If the child still was being mean, then I would encourage my child to go and play somewhere else, and to assertively tell the child, "If you are going to talk that way to me, I will go and play somewhere else."
I've gone through this a little bit the past few days on both sides of the "meanness" fence. Yesterday, my almost-4-year-old ds was frustrated because he wanted to go play with a certain neighbor boy, and I told him he had to stay home because we were having some other friends come over, one of whom was his age. He immediately started saying, "I hate Jeffrey! I wanna play with Noah!" Well, because of the circumstances, it just wasn't an option at that time. I thought he'd end up being excited to see his friend Jeff, but in reality he spent the entire time stewing because he couldn't play with Noah, and he did take it out on poor Jeff. It was just a challenging situation all around, and at times I handled it well, and at other times I didn't. Maybe the boy's mom at the park you mentioned just didn't know what else to say, since sometimes the more you say, "Don't say that! That's not nice!", the more your child will do it. Anyway, I tried to help my ds express what he was really feeling. I knew that he didn't really "hate" Jeff, he just really wanted to play with Noah at that point in time, and no other friend would do. But even with intervention, Jeff still did get some of the brunt of ds's frustration, and at the end he left exclaiming, "D______ is the meanest kid I know!"
Well, today, ds and I were at a playground, and ds got to be on the receiving end of some kids being mean to him and calling him a baby. I told him to go to the kids and say, "I am not a baby. Do not call me that." When they continued, then I intervened and helped him find someplace else to play. When we were in the car, we did have quite a long chat about what had happened and how he felt ("angry and sad") when the kids were mean to him. Then I was able to tie into the playdate with his friend Jeff the day before, and we were able to talk about how Jeff must have felt. (This was after ds told me that he was "never, ever mean to kids". I just had to chuckle to myself, knowing that only the day before he had been proclaimed "the meanest kid".)