Samwise did not write in the Red Book of Westmarch. That was Frodo's compilation (Bilbo's diary + Frodo's account + Gandalf's notes + others).
Sam kept a personal journal containing:
This journal was incorporated into the Red Book by Frodo (and later scribes). In the film, Frodo reads from it at the end.
Sam also composed poems (e.g., "The Sea-Bell" / "Frodos Dreme"), but these are separate from the Red Book proper.