Since you have 12 full days for your trip (not counting your two flight days), I would suggest 7 or 8 for Scotland, 5 or 4 for Ireland. IMHO, having visited both, there is more to see in Scotland and since it is a larger area, it takes longer to get around. Of course, if you have ancestral connections to one area, then you might want to give that area more time. Please be more specific about your interests if you want specific recommendations.
Visit Edinburgh (more sites), skip Dublin. You need a rental car for both countries if you want to visit at your own pace and maximize your time.
To get from one island to the other, fly from Glasgow or Edinburgh to Cork.
In Ireland, work your way up the west coast, Cork-Beara Peninsula-Ring of Kerry-Dingle Peninsula, the Burren, possibly County Galway for Connemara and a day trip to Inishmore (the largest Aran island.) You will have to pick and choose from the Ireland list---you don't have time for all. Galway is north of SNN but not that much farther.
Use these two web sites: undiscoveredscotland.com and irelandexpert.com