i lived there for a year too. also lived in mission hill for a couple years, spent some time in allston, pretty much lived in all of the neighborhoods that a kid could afford.
as far as brookline or somerville, youre kind of talking about two very different areas. brookline is its own town and is therefore a lot more upper class than its surrounding areas. most people living here own homes and renting in brookline could turn into an issue if you were looking to save.
somerville on the other hand is on the opposite end of town, seems to be comprised of mostly renters, and while it does have some nicer areas (davis and porter sq are always a lot of fun), definitely is on a different level than brookline.
if youre looking to live in the city, mission hill is definitely a good bet. stay on the front of the hill, thinks can get a little uncomfortable once you venture deep into roxbury past heath st. not to say itd be anything to worry about, but youd most likey rather avoid it. its got a good mix of people, a lot of college kids have moved in, especially over the past decade or so, so its cleaned up a lot from what it was say, 30 years ago. youre close to fenway, about a 20 minute walk to mass ave from brigham circle, and youve got a good choice of bars/restaurants/fast food to pick from. the t runs right down huntington, and the orange line has a stop on tremont (roxbury crossing) so its easy enough to get in an out of the city.
if youre working in waltham, brighton would get you closest if you still want to be in the city, especially oak square, youre right on the newton line. it is a bit of a trek into the city (i used to ride my bike to work on rowes wharf every day, just over 7 miles) but if youre going to be commuting to waltham itll put you in a good place and you wont be dealing with the traffic that youd get in other parts of town.
as capurnicus said, stay away from allston unless youre looking to get tossed right in the mix of the hipster mecca of the northeast. theres some fun stuff over there, the paradise is a great place to see shows, but i can confidently say that the harvard ave area of allston is my absolute least favorite part of boston. youll feel like you have to shower every time you step foot in there.
otherwise, good luck, and welcome to boston!