If you're on the 6:25 a.m. train from Oslo, and booked it all the way through to Flam (or separately booked the train ticket from Myrdal to Flam with a 12:13 Myrdal departure), you'll get to Flam at 1:10 p.m., which gives you a couple hours of free time there before the 3:30 express boat from Flam to Balestrand. It's the last express boat of the day. It can be reserved in advance and it would be a good idea for you to do that. If 2 days later you take the express boat from Balestrand to Bergen, the part of NIN that you will miss is the Naeroyfjord cruise. I think that's the part of NIN that everyone most looks forward to.
Instead, after your two nights in Balestrand, you could take the morning express boat back to Flam, do the Naeroyfjord cruise, then get on the bus from Gudvangen to Voss, then the train from Voss to Bergen.
We too are doing the slow version of NIN with 2 overnights in Balestrand. I was going to book it the way I just described but realized that the express boat trip up to Balestrand, then back to Flam, and then the first half of the Naeroyfjord cruise, would cover the same scenery 3x. We decided that on the day we leave Oslo at 6:25 a.m., we'll complete NIN all the way through to Voss. We are picking up a rental car from the Hertz facility in Voss, driving to Balestrand (2 hours), and then 2 days later we'll drive t o Bergen. This will give us a car to do things on our full day in Balestrand, and I like the idea of being on our own schedule for the trip over to Bergen. The one way rental fee is steep but we're traveling with others and splitting the car cost so it's do-able for us. The proprietor of the Hertz facility in Voss is very nice, very easy to work with. I've communicated with him by email and phone. I'd have preferred to rent the car in Gudvangen but didn't find a car rental facility there.