Has any one done this trip and if so how long.
Did it a few years ago. Started in Oslo for a few days, then did the Norway in a Nutshell package from Oslo to Bergen, staying in Bergen two nights. Departed Bergen on the night train, arriving in Oslo the next morning. After breakfast in the Oslo station, we continued by train to Stockholm. Don't remember the exact arrival time, but I do remember it was a nice, rather boring trip into the Stockholm central station, arriving early afternoon.
I have only flown between the two, but I know It's about 4.5 - 5 hours on the train. You can fly on SAS for pretty cheap if you book ahead, which includes one bag, unlike Norwegian Air. The trains to the airport on each end should be about $30. The trip by air should cost about $150 ea.
I just looked at sj.se, the website for the train and it looks like it's only $55 for 2nd class and $60 for 1st class booked ahead. I don't know why I haven't taken the train instead. Seems like a good deal, considering it probably takes 3 hours to fly after you add up all the extra time it takes to deal with airports.
Booking ahead gets you good price options by either air or train. Although the price doesn't include checked luggage, you can fly Norwegian for $55, or I currently see SAS for $73, both prices for one month away. Currently, train schedules are showing only one early morning direct train; later trains take longer with a connection.