It basically looks at each item in the selection in turn to finds the most extreme co-orndinates for the top left and bottom right. From these co-ordinates it can then calculate the overall size.
The script is a little messy and I am sure there is are better ways to format/write it - for example the first item is checked twice, once outside the loop and then again the loop, i'm sure this can be avoided but in fact it doesn't do any harm.
tell application "Adobe InDesign CS5"
set mySelection to selection
set myDoc to active document
tell myDoc
set thecount to count of mySelection
set firstitem to item 1 of mySelection
set {ytopleft, xtopleft, ybttmright, xbttmright} to geometric bounds of firstitem
repeat with myitem in mySelection
set {y1, x1, y2, x2} to geometric bounds of myitem
if y1 < ytopleft then set ytopleft to y1
if x1 < xtopleft then set xtopleft to x1
if y2 > ybttmright then set ybttmright to y2
if x2 > xbttmright then set xbttmright to x2
end repeat
set theheight to ybttmright - ytopleft
set thewidth to xbttmright - xtopleft
return {theheight, thewidth}
end tell
end tell