Use the getPageBox method.
getPageBox can get the dimensions of the following:
var aRect = this.getPageBox("Media");
var width = aRect - aRect;
var height = aRect - aRect;
console.println("Page 1 has a width of " + width + " and a height of " + height);
The dimensions are in printer points, 1/72 of an inch.