In some cases, new windows can lower energy costs and recover a substantial share of their price at resale.