An openly gay Republican has a good shot at winning a Massachusetts congressional seat, thanks in part to the Democratic incumbent’s family scandal.