Evolution of the pinning force and the vortex dynamics with the angle θ = ∠H, TB has been investigated in YBa2Cu3O7−δ crystals with vortices moving along the twin boundary (TB) planes. In weak magnetic fields, the evolution of the mentioned parameters corresponds to the occurrence of single vortex pinning for all angles θ. In strong magnetic fields an increase in the θ value up to a certain θc leads to the pinning force increase, to the change of elastic creep mechanism by the plastic one, and to the S-shape formation of E(J) curves. At θ > θc, the mode of single vortex pinning resumes. The present results are discussed in the context of the order-disorder transition in the vortex lattice, initiated by lateral vortex-line displacements nearby the TB.