The Gaia-ESO survey: Dynamical analysis of the L1688 region in Ophiuchus