We propose a more robust robot programming by demonstration system planner that produces a reproduction path which satisfies statistical constraints derived from demonstration trajectories and avoids obstacles given the freedom in those constraints. To determine the statistical constraints a Gaussian Mixture Model is fitted to demonstration trajectories. These demonstrations are recorded through kinesthetic teaching of a redundant manipulator. The GMM models the likelihood of configurations given time. The planner is based on Rapidly-exploring Random Tree search with the search tree kept within the statistical model. Collision avoidance is included by not allowing the tree to grow into obstacles. The system is designed to act as a backup for if a faster reactive planner falls within a local minima. To illustrate its performance an experiment is conducted where the system is taught to open a Pelican case using a Barrett Whole Arm Manipulator (WAM). During reproduction an obstacle is pla...