One of the hallmarks of human reaching behavior is the ability to think and generate plans for movements in complex environments. In this paper we model planning to reach for targets in space using a self-organized process of mental rehearsals of movements, and simulate the process using a redundant robot arm that is capable of learning to reach for targets in space while avoiding obstacles. The learning process is inspired by infant motor babbling, and provides self-generated movement commands that activate correlated visual, spatial and motor/proprioceptive information, which are employed to learn forward and inverse kinematic models while moving in obstacle free space. To control the arm in complex environments with obstacles, the inverse model is constrained by the visual influence of the location of obstacles to generate a purely reactive obstacle avoidance controller; while the forward model is utilized in visually planning movements when reactive obstacle avoidance is insufficient. Reach planning utilizes the forward model to recall information in order to mentally rehearse reaches that escape local minima situations that exist in the solution landscape for the purely reactive obstacle avoidance controller and achieve a path around obstacles. Perceptual information, in the form of via-points that are extracted from visual attentional shrouds around obstacles, triggers the recall of corresponding spatial regions from the forward model that were learned during motor babbling. Postures which place the end effector in each region are subsequently recalled from the many-to-one associative maps learned for the forward model, and are evaluated for comfort and distance from the planned via-point locations around the obstacles. The postures are then used by the controller to mentally rehearse arm movements from the initial configuration to the target. Simulations show that the proposed novel controller is successful in planning reaches while avoiding obstacles in environments with complex obstacle configurations. This proposed model is fault tolerant and can handle a wide range of perturbations such as joint locking and the use of tools without experiencing them during learning. The simulation results of our biologically plausible approach highlights its practical utility in applications where the environment is full of obstacles and the robot needs to possess the intelligence to avoid them while performing reaching tasks thereby ensuring safety and reliability.