If you want to live in the Andover area for personal (commute) reasons, then take steps to do so, and don't stay straddled between Andover and Central MA. The commute will suck the life out of you eventually. In order to afford, consider a 3-4 family to live in. While it may not cash flow, it will reduce your living expenses through the rent on the other 3 units, and will give you valuable experience in investing and landlording. Lowell, Haverhill and Lawrence all provide lower cost opportunities. You don't mention children, so I assume you don't have to worry yet about the quality of the school system. If and when you do, then hopefully you will have saved for a downpayment on a house in a better area, and can convert your multi to an all-tenanted building.
I don't suggest choosing a bad neighborhood to get costs down, as you will have trouble maintaining good tenants. Rather choose a better neighborhood with deferred maintenance that you can partially do yourself.
It will take time to find this property.