You also should hire an inspector and have an inspection before you buy. There may be a lot more things wrong with it. The walls have probably shifted with the sag and getting the foundation level may cause a need for repairs to the walls, etc. Sometimes when a house settles gradually over time, you need to level it gradually to avoid damage to plaster walls, etc.
Have some contractors come out and give some bids to fix it. They can see it first hand and tell you what it needs. The cost and the inspection results will help when you go to dicker over price with the buyer.