pdetool is an easy way for first-time users to get started with MATLAB PDE Toolbox. It can also be used for some realistic analyses since it supports a non-trivial subset of the capability of the toolbox. However, I know of no straightforward way to use it as part of an automated analysis.
The recommended approach for automating a PDE Toolbox analysis is to perform all operations using function calls from within a MATLAB script. All of the runable examples that are shipped with PDE Toolbox use this approach.
Geometry, mesh, and coefficient creation using PDE Toolbox function calls are relatively straightforward-- essentially the same as performing the step in pdetool. Assigning boundary conditions from the script is significantly different than within pdetool and, perhaps, it is not immediately obvious how to do this. The recommended approach is by using a user-written function called a "boundary file" in the PDE Toolbox documentation. This is documented here:
http://www.mathworks.com/help/pde/ug/boundary-conditions-for-scalar-pde.html
http://www.mathworks.com/help/pde/ug/boundary-conditions-for-pde-systems.html
A good, example showing a complete analysis is here:
http://www.mathworks.com/help/pde/examples/nonlinear-heat-transfer-in-a-thin-plate.html