Hard to give an answer without knowing more details (interest rates, remaining principle on loans, especially how soon the new roof is needed). Maintaining the value in your home (unless you are planning to walk away from it or short-sell or something) is of paramount importance, and the cost of a leak should it happen can be substantial.
If the roof is a few years out, and you have loans with interest rates about oh I'd say around 6%or more then I would pay off those loans and take the money you were paying there and start putting it into a fund to pay for the roof.
I am also a huge fan of doing whatever you can to max out your 401K contributions. Money put into a 401K early has a LOT more value than money put in later, and since you don't pay taxes on it, the cost out of your pocket is much lower (eg. at a 20% tax rate it costs you only $80 out of pocket to put $100 into your 401.. (look at that, you just made like 25% return on that $80)
Paying off loans is pretty much equivalent to making a risk free return on the money equal to the interest rate on the loan. But to REALLY make that work, what you need to do is in a virtual sense, keep making the loan payment just now pay it to yourself, putting that money into a savings account, or towards your 401K or whatever. If you just torn around and start spending that money, then you are not really getting as much value to paying off the loan early.