Tuning terahertz vibrations to control flexibility in soft porous crystals