One way to find out if it's the lines or not, the next time they start to lock up, loosen the banjo bolt at the master cyl and see if you can bleed off the pressure to release the brakes. If yes, then your problem is not in the lines, if not, you most likely have a line issue, and time to replace them.
Just be careful of brake fluid on the paint, not compatible........ :yow
There could be a very remote potential of the ABS controller causing you an issue(only because it is in the brake circuit), but I can't say as I have heard of anyone with your same symptoms finding the problem in the ABS. It's usually been in the MC or lines.