A 330-360 GHz spectral survey of G34.3+0.15 .2. Chemical modelling