Andrew,
Regarding the rents in those areas you mentioned, yes and no. Obviously Malden in particular has some seedier areas. Medford, Somerville and Melrose, you're almost certainly priced out of at your price point unless you get a place that's falling apart. The rest of the place you mentioned will get you higher rents, to some extent, but they won't offset the property price differentials. These are the areas my wife and I originally were looking (we live in Melrose), but we shifted because of the cap rates.
However, again, it depends on what you're looking for. If you're trying to raise cash from the property, you'll probably need to find a place that has predominantly renters and therefore has higher cap rates. Salem and Peabody have what you would probably consider higher caliber tenants than, say, Chelsea. That being said, my property in Chelsea brings in huge amounts of cash with lower caliber tenants. And you can screen tenants and find perfectly good tenants just about anywhere on the north shore.
My advice is do your calculations. BiggerPockets has good investment calculators. If you're not looking for cash out of the property, but rather a long term wealth creator, you may be able to find a slightly better location. You'll just be much more sensitive to vacancies.