Measurement-based preparation of non-Markovian and multimode mechanical states