1. Be clear with the author before you start whether your name will be on the book. Some collaborators charge one fee if their name is on the book, and increase the fee if they get no recognition.
2. If it's a royalty project, who will market the book? Will you sell the book through an agent? If no agent is involved, who is responsible for the sale? (The author usually doesn't know the business and normally that task falls on the writer.)
3. Consider adding an escape clause. If the person isn't happy with you or you're not happy with the author, you need an easy way to break it off.
I usually say that if either party wishes to terminate the contract, a simple letter to that effect is all it takes. You do not return any money. If, for instance, you receive half of the agreed-on price and you do your job, but the author isn't satisfied, let the author stop the proceedings. You will have done what you agreed to do.
One time an author severed the relationship and wanted the money back. I had agreed to write a self-published book for a concentration-camp survivor of World War II from Eastern Europe. I did it on a three-part payment plan. After I completed the initial agreement of sending him sample chapters and a synopsis, he became ill. His lawyer terminated the agreement and asked me to return the initial payment. I sent him a copy of our covenant and I never heard from him again.