Q1 - To prevent sagging you can always add a small shelf stud fairly discretely mid point between the shelves.
Q2 - The quality of painting, or any job for that matter, is all in the preparation. Yes, sanding is important for a good looking finish. Untreated wood needs a primer coat...