Never mind the “borderless” situation being due to the Good Friday agreement, which is not EU-brokered. If anyone would be erecting borders after a UK departure, it would obviously be the EU itself, walking all over Ireland’s sovereignty and inserting itself into an agreement that does not concern them.
Indeed, if the UK left the EU it could negotiate any deal with Ireland it wanted, including maintaining the status quo. In fact, the UK and Ireland already have an arrangement called the Common Travel Area which provides for open borders in all the British Isles. That’s a bilateral agreement unrelated to the European Union. So they can continue it if both countries want that.
Problem solved.