firstly she could join families need fathers. don't read into the name of the charity as it is an shared parenting charity and has many mothers and grand mothers as members. gilly from this forum is also a member. secondly, in law, anything someone considers to be harrassment is harrassment. she could go to the police and log a complaint. a family solicitor is not always the best way to go but your friend does need to see someone for advice.
I notice on your profile you are in scotland. is your friend in scotland too? I ask as family law is different in scotland to england and wales and I am not overly familiar with scottish law. FnF has many scottish members so again will be worth joing and asking on the self help forum for help. whatever jurisdiction she is in though, a court process can be long and stressful. a mediated settlement may be the way to go with a court rubber stamping it. but whatever she does, she needs to sort it and stop her ex from harrassing her as ultimately the child will suffer too.
not much help I am afraid, I may be able to say more if it is english law!!
it may be useful for you to go see the police. I don't think you can make an official complaint but they may just make a record of your visit so having something down officially? you are right, a diary/record of what he does is a very good idea, dates, times and a brief outline of what was said. for texts, get her to transcribe the text message onto paper straightaway, refer to the text in her record/diary and keep the text on her phone too. texts on phones are rarely viewed as evidence in courts but a transcript backed up by the actual text is good and in family law is often admissable.