In August, 2018, the State Bar of Texas Professional Ethics Committee issued an opinion regarding attorney-mediators writing a settlement agreement.
Their conclusion is that if a Texas attorney, acting as a mediator, does NOT violate the Texas Disciplinary Rules of Professional Conduct by preparing and providing the parties a draft of a written agreement that memorializes the terms of the parties; settlement reached during the course of the mediation or by suggesting additional terms for inclusion in the draft agreement.
Here is the link
This opinion also references Opinion 583 that was issued in September 2008, that concluded that a lawyer may NOT agree to serve both as a mediator between parties in a divorce and as a lawyer to prepare the divorce decree and other necessary documents to effect an agreement resulting from the mediation. Because a divorce is a litigation proceeding, a lawyer is NOT permitted to represent both parties in preparing documents to effect the terms of an agreed divorce.