(NOTE: I'm going to type out all the commands for the sake of anyone relatively new to MEL.)
You'll want to look at the scene node called "defaultResolution". You can verify its existence with this command:
You can get a list of all attributes connected to that node via the "listAttr" command:
The list of attributes for defaultResolution includes entries for width, height, and deviceAspectRatio. To query those attributes:
Of course you can assign those values to variables as needed:
$width = `getAttr defaultResolution.width`;
$height = `getAttr defaultResolution.height`;
You may also want to check into the default nodes called "defaultRenderGlobals" and "defaultRenderQuality". They may contain additional rendering information that you may need.