Regarding 3d indent input script.

Examples in LAMMPS/examples/indent/ is a good place to start.

Ray