Toward an optomechanical control of photoswitches by tuning their spectroscopical properties: Structural and dynamical insights into azobenzene