The answers to this question have been split into two parts:
Part 1:
Why did Nietzsche believe that atomism was refuted? And
why would he claim that atomism is "well-refuted"? Or
why would he claim that Boscovich had helped to refute [atomism]?
Part 2: Did Nietzsche assert that it is obvious that the universe and all matter is continuous (not discrete)? And
was this really the consensus at the time?
Answer to Part 1:
In aphorism #10 Nietzsche mocks the 'zeal and subtlety' with which the problem 'of the real and apparent world' is set upon by holders of metaphysical and sceptical anti-realist positions. The holder of the latter position, especially, opposes appearances, dislikes the word 'perspective', distrusts their own bodies, distrusts modern ideas and regards positivism "with the disgust of a more fastidious taste". Nietzsche criticizes their positions with the posture of both scepticism and materialism.
Love (1987) says:
"Nietzsche criticized materialism, but he was still fundamentally a materialist… What Nietzsche criticizes is materialist atomism which he mistakes for materialism itself. He argues that materialist atomists, like the idealists they criticize, are metaphysicians".
Love also mentions that the distinction between materialist and idealist ontologies must not be confused with that between sceptical and realist epistemologies, but I would like to not get too bogged down with the details of this and focus on the idea that Nietzsche mistakes materialist atomism for materialism because I agree with Love's assertion. Ignoring the 'materialist' in 'materialist atomism' in this case takes away from the general sense of the meaning.
Therefore, taking 'materialist atomism' in aphorism #12 as 'materialism', Nietzsche believed that materialist atomism was "well-refuted" because scientists such as Copernicus, with his model of the universe, persuaded everyone to believe, "…contrary to all the senses, that the earth does not stand firm…" and Boscovich, with his atomic theory, "taught us to abjure belief in the last thing of the earth that stood firm, belief in 'substance', in 'matter', in the earth-residuum and particle atom".
For Boscovich these findings made it difficult for him to work within the church. According to the MacTutor History of Mathematics archive, although Boscovich was a staunch Christian, he found his position in Rome becoming rather uncomfortable, i.e. his scientific views did not sit comfortably with his religious views, and he requested permission to travel and this was granted. Boscovich's distancing from the church and endorsement of modern ideas was demonstration enough for Nietzsche to claim that he had helped to refute soul atomism (not materialist atomism, as stated in your question).
Answer to Part 2:
By making reference to the achievements of science, Nietzsche was asserting that the hypothesis that the universe and all matter is continuous (not discrete) had all but been abandoned by science, however, soul atomism (and I would designate it 'immaterialism', putting it in terms of 'materialism) in the church prevails and, indeed, "still goes on living a dangerous after-life in regions where no one suspects it…". That the opposite to the scientific consensus was the consensus at the time in the case of the church, was something that was not obvious to everybody and Nietzsche wanted to highlight this.
References
Nietzsche, F. (1886) BGE. Prelude to a Philosophy of the Future. Trans. R. J. Hollingdale (2014). Penguin Classics.
Love, N. S. (1987) Epistemology and Exchange: Marx, Nietzsche, and Critical Theory. New German Critique. No. 41, pp 71 - 94. JSTOR, www.jstor.org/stable/488276 accessed 19.07.2019
MacTutor History of Mathematics archive https://www-history.mcs.st-andrews.ac.uk/Biographies/Boscovich.html accessed 22.07.2019