This is technically trivial. Anyone running a very long computation
(and some real computations can last for weeks) will regularly save
the state of the computation on some reliable medium that does not
need power, so that the computation can be restarted after any kind of
failure. Actually there can even be several levels of back-up,
balancing reliability and cost.
The computation does not need to be restarted with exactly the same
software, as long as the intermediate results that have been saved can
be interpreted and reused by the new software. Actually this can even
be a way to improve the software (or the hardware) while the
computation is on-going. This is standard technology, even for people
who are not time-lords.
The screwdriver could simply save its state on the Tardis whenever
there are close enough to communicate by whatever means. It could also
be saved in various places known to be stable in time by someone who
travels through time.
If the screwdriver is destroyed, only that part of the computation
done since the last back-up is lost and must be redone.
By the way, since the Doctor travels through time, he could well
organize the computation and back-up to get a lot more than 400 years
worth of computation, depending on the structure of the algorithm and
the computational capacity of the screwdriver.
It is to be expected that the computation does not take all the
computational power of the screwdriver. If a computational thread
actually leaves a lot of untapped computational power, it can be
parallelized with a future fragment of the same thread by getting from
the future the starting state for the later thread. Time travel
extends the possibilities for parallelizing computations.