5 hours is a reasonable estimate assuming there are no hold ups like traffic or road works.But your nearest airport after Bergama would be Balıkesir(with very limited flights and only to Istanbul)or Izmir.From Bergama you are only 90 minutes from Izmir so why go all the way back to Balıkesir?-a retro move :)
If you return the car at Izmir (which yes, is possible)how would you get to Alaçatı or Selçuk Ephesus?Why not just hang on to the car and hand it back before you go to Cappadocia.
From Bergama it will take you c.2½ hours to drive to Alaçatı where you could stay overnight,take a look around the village next morning and then leave c.noon-ish and drive to Selçuk Ephesus and visit the site in the afternoon..
There you can stay 2 nights using one of the days to visit Pamukkale.
BTW,most people visit there either as day trips from Selçuk by bus,train or car or they stop off there on the way to or from Selçuk and Cappadocia using the overnight bus.
From Alaçatı it isn't a long drive as you don't need to enter Izmir city centre.take the E881 as far as the Buca intersection and the follow the signs for Ephesus on the E87 direct into Selçuk.This will take you c.2 hours or very slightly more.From Buca intersection it is 45 minutes to Selçuk that's all.
There is an airport in Denizli,Çardak Airport but this is outside the city,90 minutes from Pamukkale and ,like Balıkesir airport handles only limited flights just to and from Istanbul.This is true for most of the smaller regional airports here;that they work on a radius route from either Istanbul or Ankara.Small regional to small regional direct flights are negligible I'm afraid.
So I'd stick to the coast route and then see Pamukkale as a day visit from Selçuk.
You know what?I hate my posts to you as all I seem to say is no,no,no,no to all your idea's.I worry this is dimming your enthusiasm!That isn't my intention trust me, but I am trying to be realistic in what is doable and practical and what would leave you with a frantic and unsatisfying visit.Like others I'd have said drop Troy but have worked in it because I understand this is important for you ,as is Alaçatı (despite that it will be rather end of season-ish there).So apologies for the no,no,no's but this is the reality check haa haa haa.
You are not going to be able to lose all the one nighters either because you have large distances between places plus need to factor in viewing time remember.But at least I've given you 2 nights in Selçuk :)
Where did you get 3 hours for Izmir to Ephesus??It is only 60 minıutes into the city heart!It is however 3 hours from Selçuk to Pamukkale,so you need to be off bright and early that morning.
Although it is probably sacrelige to say so I guess you could knock a day off Istanbul to free up time for the Aegean or knock a day off Cappadocia......But ultimately you really need to accept that to see the things which are very important to you means having to sacrifice some others and that however you do this section is going to mean a fair amount of time behind a wheel.
Also ,just to back track,take another look at the very first itinery I suggested-the one with Troy at the end.Logisitically this worked out very well as you know and if Troy is important to you then you should have no fear of being disappointed in the site.I'm sure you've seen enough photographs online to know this is not a complete site like say,Ephesus, and so are prepared for this.When I gave you that I wrote it thinking that if this was my trip that's how I'd do it,(but I aren't recommending it just for that reason!) but because the logistics offer the most relaxed option in the time available.