Indeed! Written agreements are a must even with friends I think, just to clarify things. I both bought and sold a horse in similar circumstances and it worked out fine, I'm very glad to say. Same with liveries.
Having been both a livery and a landowner having everything in writing takes away any misunderstandings. Doesn't help with badly mannered horses or people, but does help. I had two field liveries that were theoretically DIY, but I ended up doing everything most of the time, for sporadic payment, from daily winter feeding to holding the horse for the vet and farrier as I wouldn't see them suffer. I even ended up paying for and giving one, a pregnant mare, essential supplementary feed as she was turning into skin and bone and I couldn't stand by and do nothing when the owner never even bothered to come and see her. I learnt from these and since then, I've added it into the agreement, that I will feed hay daily when I feed mine (it stops fighting etc if they're in together), look them over at the same time and charge a little for other services, like holding for farrier etc, but put it in writing. My most recent livery was lovely: helpful and friendly and always paid up on time. Sadly she moved out of the area, but she said she had never been at a place that was so nice. *smug smile*
As a livery, I've had my horses brought in when I've asked for them to stay out (arthritis), had them shut in without food for 48 hours when I've asked (and paid) for them to be fed and turned out, had them moved into different fields with strange and sometimes aggressive horses when I haven't been present and (I suspect) had them ridden by the yardowner's friends without my consent.
I'm happy having my own land and only my horses on it at the moment, but would take on another livery under the same arrangement.