What part of the Irish Republic are they going back to? If they're fairly close to the border, the contract could still be useful as they might still be able to receive an O2 UK signal.
Other than that, it's not possible to transfer a contract like you've described, as already pointed out on this thread. However I've a friend whose contract allows him to use some of his minutes while roaming on O2 IRL, it may be worth negotiating with O2 to see if this facility is possible for the remainder of their contract if they're tied to it. Just for reference though, I can't recall seeing it anywhere - it's just my friend mentioned it.