Don't write anything now that you'll be ashamed of five or ten or twenty years from now.
Think ahead of things you can write, so you won't take up too much time with anyone's yearbook.
Bring a pen you like to use. Don't chose one that makes too wide of a mark or that will bleed through the pages.
Find more advice at http://www.wikihow.com/Sign-a-Yearbook