Exploiting periodic modulations to control quantum states of optomechanical systems