500 lines or fewer lines; but 500 lines or less code.
Yes! I often find myself making this point -- i.e. that the supposed problem indicates that the reader has made an incorrect assumption about an imaginary elision. Cf. "5 items or less [stuff]", "$5 or less [money]".