$.max and $.min should give you the coordinates
...of course, you'll want to do it in parent space.....
Probably a simpler method would be to position your rectangle at the end of the line, find out how much it's travelled to get there (look at bottom transform boxes to see distance WHILE you're moving it), then reset it's position and in wiring parameters, just tell it not to let Y travel more than that much (assuming your controller is zero'd out, so that its Y position is 0 when it's at the default position on the line.