It'd have to be something where it looks like the country is going one direction, but in a shock outcome the opposite is the case.
I think the most likely candidate is a referendum on repealing the eighth. Imagine polls showing a slim majority in favour, but the result being a landslide NO everywhere but Dublin and other cities.
Or else imagine that a fresh Euro crisis leads to a referendum on leaving the Euro, with the same result as above. This one's pretty unlikely, but I could easily see a referendum like it passing if it was called.
Then someone anti-establishment emerges as the figurehead for the "silent majority" -- let's say it's Ming, for example-- which leads to a new nationalist populist movement.
A major recession fuels their rise. That, plus fallout from Brexit and Trump's 'America First' policies, leads to Ireland turning inwards and away from Europe. Add another trigger if that sounds implausible -- terrorism? refugee resentment? foreign companies moving away? Russia invading the Baltics, and a clash with the EU on neutrality?
Rather than making a new deal to leave, we just take whatever was offered to the UK, after their years of negotiation.
Then, just as we entered together in 1973, Ireland and the UK take one another's hand, and confidently step backwards into the future.