score:4
You’ll go through immigration in Dublin, then your flight to Edinburgh will be treated almost like a domestic flight, and you won’t go through immigration again in Edinburgh, although you will go through UK customs.
In general, the rules of the Common Travel Area mean that when admitted to one country you can travel to the other fairly freely.
There are a few complications though:
The UK government website has more information about travelling from Ireland to the UK