The same code as it is will not work for tetrahedron. The present code works for 2D 4-noded element. Your's is 4 noded 3D element. But the same analogy can be easily extended to Tetrahedron.
16 May 2014
a code is written to extract stress in 2D plane stress analysis