The script implements the Catmull–Clark algorithm of mesh subdivision.

Just use the "Torec/Subdivision" utility in Editor
or the following procedure on development or at runtime:
public Mesh Subdivide(Mesh mesh, int iterations)