Definitely get the visa before. On one occasion it took 2 hours to get visa in Dar, and the chaos can be overwhelming if you are not used to it. Once in ZNZ need up to north. We did the Spice Tour and it was very interesting. Stone Town is great. The Tanzanian people are very friendly.
The whole family really loved Hoi An. Do the Heaven and Earth bicycle tour. Lots of great cafes, old buildings, authentic markets and friendly locals. There is something there for everyone albeit very touristy.