This is a non-script approach. You can create this fractal adding a tetrahedron with Extra Objects add-on. Then subdivide it **once**, remove middle triangles and make inner faces. Repeat the subdivide once and remove and  make faces steps a few times. Scale the fractal down and then animate scaling it **up** to show the structure.
[![enter image description here][1]][1] 


  [1]: https://i.sstatic.net/fCF8r.jpg