Agree with comments. Scenic train is a must if going to Andalsnes but having done it independently rceently very little saving from ships excursion which surprised me (£40-worth every penny if fine).
Ship's excursion costs £48 but is coach one way and train the other. I would recommend the ship's excursion because I think the views are better from the coach plus you get a couple of photo stops but you also get to ride on the train so you get the best of both worlds.
Depends which ports you are visiting but as a general rule you can certainly do your own thing in Bergen and Stavanger as you dock in town. A walk to the Bruggen area of Bergen and up the mountain by the cog railway is worth doing and a walk around the pleasant town of Stavanger is enjoyable. At Flaam you can purchase your own ticket for the railway to Myrday which is outstanding but you need to get off the ship quickly to avoid long queues and I advise you to get the same train back to Flaam. At Geiranger I would suggest you book a ship's tour to Mt Dalsnibba and at Alesund possibly also take a trip as the town is a bit limited. You will need to take some Norweigen krona - possibly about £200 for tavel, drinks and souvenirs.
I agree with you, we did own thing in bergen it worked out much cheaper and the funicular(?) mountain train is only a 15 minute walk from the ship, the train in flaam is also very close to the ship but as you said best to stay on the same train to come back. if you go to olden it is probably best to do a trip as the only things to do there is hire a bike,go for a walk or go on a very expensive road train, if you go to stavanger check out the water at the side of the ship it's full of jellyfish! when we got to our cabin there was a folder with maps and general information on each place we were going to. if you do decide to book a tour don't leave it too late to book as a lot of people on the ship left it until we were on board and couldn't get the trips they wanted. have a good cruise it's amazing in the fjords get up early and sit on deck to see the most beautiful scenery in the world we were out there about 6am and it was stunning!
We have just returned from The North Cape and Norway and did not book any excursions. Norway is expensive compared to UK. Most people speak english and are very helpful. Shuttle buses are generally available but were about £5 per person. Some plasces were within walking distance. We did Trondiem on the shuttle which dropped us by cathedral. Ticket for cathedral, crown jewels and museum was about £10 each and the War Museum was free. Read up on places on internet before you go. Stavanger and Bergen very easy to do. If there is a trip to the Birksendal Glacier from Olden and you are fit and well go for it as it is amazing a you cannot do it yourself.