Preparation and control of a cavity-field state through an atom-driven-field interaction: Towards long-lived mesoscopic states