Dispersion relations for the vertex function from local commutativity