@Mohsin Mazhar the wife and I relocated to Lowell from Quincy, and prior Jamaica Plain, 15 years ago and are extremely happy with the City. Live in Lowell, buy two houses, save time, energy, money on your commute, and embrace the arts scene and cultureS-- plural emphasized. Speaking as a resident, that's one of the things we love most about the city is the plurality and diversity in both demographics and in available arts/college scene/ historical values. Many great cultural roots here. Lowell's really got it all.
Other people also mentioned Southern NH, and Nashua and Salem are great cities with a reasonably easy commute to Lowell.
Definitely do your research for two reasons: 1) NH residents get killed in property taxes but there are no sales or income taxes.
2) because of that lesser tax base, NH residents get significantly fewer benefits, including unemployment in the event of layoffs, etc. The fact that you're working in Mass should temper the second point for you, fortunately, and the first point, unfortunately-- you'd still need to pay income taxes to Mass. None of this may be quite relevant to you, but no Mass V NH analysis should be complete without reviewing these variables.
Am I bullish on Medford? Absolutely not but as others have already stated, deals are VERY hard to come by in that turf. Newton is even worse, but will almost never lose value.