Another possibility would be to use sourceRectAtTime() and toComp() to establish the corners:
L = thisComp.layer("square");
r = L.sourceRectAtTime(time,false);
ul = L.toComp([r.left,r.top]);
ur = L.toComp([r.left+r.width,r.top]);
ll = L.toComp([r.left,r.top+r.height]);
lr = L.toComp([r.left+r.width,r.top+r.height]);
xMin = Math.min(ul[0],ur[0],ll[0],lr[0]);
xMax = Math.max(ul[0],ur[0],ll[0],lr[0]);