var height=
activeDocument.activeLayer.bounds[3]-
activeDocument.activeLayer.bounds[1]; //3-bottom, 1-top
height = height.toString().replace(' px', '');// remove 'px' string
//here we have height set
The same way we can get width, replacing 3 to 2(right-coordinate) and 1 to 0(left-coordinate).