When booking tours and shore excursions there are a couple things to keep in mind.
First of course is how long your cruise ship is going to be in port. This will determine the length of any inland tours.
Also, a common practice is to book all or the majority of your excursions while booking your cruise. This provides peace of mind and many people do (we did). The rationale is the cruise ship guarantees they won't leave the port without you if you somehow are detained and also keeps you from being shut-out by attempting a last minute on-shore booking.
However we think on-shore booking has it's place too. It's quite common to reach a port having some free time and nothing previously booked, excursion-wise, to fill that time. At this point a spontaneous booking is worth considering.
One good reason is it's less expensive, sometimes significantly. Secondly, excursion operators along the Alaskan coast know their business largely depends on the cruise ships so they're not going to risk you being late to re-board. And, many of these companies will also guarantee your timely return.
So in spite of the above concerns we think spontaneous on-shore booking is worth considering. Great excursion rates can also be found from a cruise broker.