"Before the EU was established one had the right to live in Spain, Greece or wherever....what will change if the UK opts out? "
Well, I didn't. When I came to Greece, you had to have a residence permit, which was entirely at the discretion of the government, in theory, and at the discretion of the local policeman, in practice. At the moment, you don't need a permit, you simply have to register your presence.
In fact, I've never had a residence permit, as when I applied, they asked "what's your job?". When I replied "I write computer software", the copper banged his fist on the counter and said "Go away! Come back when you have a proper job".