Good point and question @IWRATS.
I presume from a quick look at your link that the agreement refers to NI only. Solving the NI problem is way above my grade, but I would say that I wouldn't have started here, but 1921. Does the agreement specify the form of the referendum, and how the result of the referendum would be taken forward to union with the RoI?
I would be sceptical of a change based on a simple majority (as per European referendum) although in most respects I think the decision for people in NI would be a lot simpler than the European one. On my previous thesis I would perhaps say that if a NI Assembly were to be elected (rather difficult at the moment I know) by a significant majority, 2/3 maybe, by parties fighting the election on a clear manifesto of union with Ireland, that should be a satisfactory basis to move towards unification. The sadness is that before the EU referendum the constitutional position in NI allowed a kind of interpretation where NI was both in the UK and in the RoI.
As for the Scottish Question, similar problems arise; not enough information to make a decision, and as you point out, the problems of our first past the post electoral process for Westminster. There has to be something like John Smith's 'settled will', and we're not there yet. You could argue that the 2015 GE showed a settled will when 56 out of 59 (Scottish seats) SNP MP's were elected, but it didn't, people voted for many different reasons (just like the EU referendum, and the Scottish referendum) and that support is quite volatile. I don't know the answer, but it isn't a referendum.