Replacing the windows also helps folks who are buying to make an easier decision on which house they want. In my experience whenever a prospective homebuyer is looking at the house as I do the inspection, the less things they have to worry about, the better it is for them.
Now as for getting your money back? Your realtor can give you a better answer to that area of the market. But as long as the house sits for sale, you keep paying on the interest of your mortgage, you do the math on that one. If you stay an extra 3 months because nobody wants the home, and your interest is 1000 a month, you could have paid for the windows.
Good luck.