I sometimes assign a kind of star ranks to itineraries. The number of stars is to be the number of nights divided by the number of destinations. So, in your case of 5N,
One-star itineraries: Number of detinations is 5(, 4, or 3)
Two-star itineraries: Number of detinations is 2
Three-star itineraries: Number of destination is 1
Your last one was no star, but if you choose a set of Hakodate, Otaru, and Sapporo, that would be nearly two stars.
Now start to create a plan. Google Maps say
Sapporo - Otaru, Car/0:40-1:15, Bus/0:58
Sapporo - Hakodate, Car/3:50-5:00, JR/4:09-4:14
Hakodate - Otaru, Car/3:50-5:10, JR/4:52-5:15
Hakodate is far from Sapporo and Otaru. JAL and ANA provide campaign flights to Hakodate with 5k+ JPY. CTS is notorious its business. It would be better to use CTS for an arriving airport. JR runs a direct train from CTS to Otaru. For the flight to Hakodate, use OKD near Sapporo. So, the backbone should be
HND - CTS - Otaru - Sapporo - OKD - HKD - Hakodate - HKD - HND.
Then, here is an example. I just choose a bus from Otaru to Sapporo, to avoid a simple repeat use of JR. The resulting Otaru(10h), Sapporo(13h), and Hakodate(12h) look reasonable.
Aug 30 W
HND 1100-1235 CTS, ANA 61
CTS 1300-1415 Otaru, JR
Otaru 1415-1815(4h)
1815 Sunset
Aug 31 T
Otaru 1100-1715(6h)
Otaru 1715-1817 Sapporo, Hokkaido Chuo Bus
1812 Sunset
Sep 01 F
Sapporo 1100-1810(7h)
1810 Sunset
Sep 02 S
Sapporo 1100-1730(6h)
OKD 1730-1810 HKD, JAL 2755
1808 Sunset
Sep 03 S
Hakodate 1100-1808(7h)
1808 Sunset
Sep 04 M
Hakodate 1100-1640(5h)
HKD 1640-1805 HND, ANA 4760
1804 Sunset
The above is more like on a textbook, so here is another one. You could drop Otaru to preserve a time for Sapporo.
Aug 30 HND 1100-1235 CTS 1400-1540 Jozankei
Aug 31 Jozankei 1700-1808 Sapporo
Sep 01 Sapporo 1113-1145 Otaru 1740-1820 Sapporo
Sep 02 OKD 1730-1810 HKD
Sep 03 Hakodate
Sep 04 HKD 1640-1805 HND
http://jozankei.jp/en/http://www.sapporo.travel/find/?lang=enhttp://www.sta.or.jp/english/http://otaru.gr.jp.e.go.hp.transer.com/