Code:
$fline(windowname,^$,1,2)
works exactly like the hypothetical $window().line. The reason it works is that the line marker is actually an empty line; this is the only way to have an empty line in a mirc window: even when you /loadbuf files with empty lines, those are converted to a single space. So, scanning the window for an empty line is an accurate way of finding the line marker.