A key route through a Wiltshire town has reopened after flooding.