Portsmouth to Dover is usually about 15-20 minutes depending on your route. It does get congested on the Sullivan bridge during rush hour...but there are plenty of other ways to get there.
Hampton Beach is safe....but not necessarily desirable...it attracts a different type of crowd in the summers, low income in the winter, and tons of traffic.
Look into getting a place north of Boar's head in Hampton (along or north of the seawall) and you'll enjoy it.....I do. I never venture down to the village district and don't notice much if any overflow from it, other than increased motorcycles in the summer that feel the need to rev their engines and speed down my street at all hours....and I live in a completely residential area