Three to seven years is a long time. Would it be worth having one basic troop transport (perhaps with another role?) at game start for situations like this, so that you could leave shipyards geared for warships, scouts and freighters etc, or would it take too many research and build points needed elsewhere?
It would have been a good idea, yes. Unfortunately, at game start I had no researcher at all in two of the Tech fields, and had to spend about two-thirds of my points covering those bases... so I was really tight for research points.
You can only tool a shipyard for a ship design that has been created and you can only design ship if you have all of the techs researched. Those techs are not going to be researched very early by anyone unless they are "cheating".
I expect that it could be done if you were willing to focus the points on it... but I wasn't in a position to do that.