That location is hard because the most convenient places to it are some of the more expensive parts of the Boston area, like Brookline. The atmosphere in Brookline is fairly unique but Jamaica Plain (part of the city of Boston) may have what you need. It's a bit south of Longwood, with a bus line that goes there, and it's along the Brookline line. There are some 2-BR in Brookline and in JP under $400,000.
You would need to be somewhat careful since the area varies significantly. The area from Centre St. west to the pond is very nice and generally safe, while other pockets near Jackson Sq. or Stony Brook on the Orange Line are not so safe, and the area near S. Huntington Av. is still a bit scruffy. Centre St is where the bus runs and where stores/restaurants are so it would be good to look close to that.
Another possiblity is in Newton along the D line of the Green Line. It's generally more suburban than Brookline (though Brookline has some woodsy estate areas), but it's very nice and safe. Newton is expensive but there might be something in Newton Upper Falls, which is not too, too far from the D line at Eliot.
Although it is hard to project five years out, it can be cheaper to rent than to buy in Boston, even after tax savings, and there are indications the market will be going down somewhat significantly in the next couple of years. This might not be the best time to buy.
This is a pretty good website for what's available:
California / Massachusetts Homes for Sale and Real Estate - Map Search - Movoto
You can enter the ZIP codes to see what's where. JP is 02130, Brookline is 02445 or 02446, you can also type in "Newton" or 02464 for the area I referred to. To adjust the options for your price range and BR, see the little bars to the right of the map.