Is there a word in English for this particular type of humourous use of a word twice

As far as I know, there is no word for this specific example of using a word twice in a humorous way.

I can, however, point you to similar sentences which exhibit the same kind of humor, and explain why they all are funny. One might group them under the heading of quasi-Moore paradoxes or performative contradictions.

First, let's analyze your sentence. With the nucleus of the sentence, the speaker affirms that he never called a particular person a bastard. With the right dislocation, however, the speaker does call that person a bastard. The humor derives from the incongruity between the nucleus's implication that the speaker does not think the person in question is a bastard and the dislocation's implication that he does (at least now) think the person is a bastard.

A related sentence comes in the form of Moore's paradox:

  1. It's raining, but I don't believe it.

The (mild) humor of this sentence comes from the incongruity of a speaker using the first part of a sentence to affirm "it's raining", which implies that he believes that it's raining (speakers typically only affirm things that they believe), then using the second part of the sentence to reveal that he doesn't believe what he just affirmed.

In the language of speech act theory, one would say that the speaker violated the felicity conditions associated with affirming "it's raining," one of which is believing that it's raining. Another way of putting this is that the speaker's act (or sentence) is a performative contradiction.

This kind of incongruity can happen not just with affirmation, but also with imperatives. One of the felicity conditions of uttering an imperative is to think that the person being directed is able to perform what's ordered of them. Violating this felicity condition can lead to (mildly) humorous sentences like:

  1. Pick up that car, although I know you can't.

Returning to your sentence, one of the felicity conditions of performing an emotive speech act (like uttering "ouch!", "oops!", or "damn!", or using an emotive term like "fuck" or "bastard") is to be in the appropriate emotive state. In your example, there is an incongruity because with the first part of the sentence ("I never called him a bastard") the speaker suggests that he's not (or was not) in a certain emotive state, but he betrays this suggestion in the second part of the sentence ("the bastard!"), which does suggest he's in that emotive state.

While your sentence is not exactly Moore's paradox, since the nucleus of the sentence, being past tense, doesn't strictly commit the speaker to the opposite felicity conditions of the dislocation, the following variant of it would be closer to Moore's paradox:

  1. I don't think he's a bastard, the bastard!

Because the nucleus and the dislocation are "of the same tense", we can regard their felicity conditions as being genuinely incompatible. The result is a performative contradiction.

These types of incongruities between the felicity conditions of various parts of utterances are a very rich source of humor.