Shakespeare’s Subjunctive
If it were done, when ‘tis done, then ‘twere well it were done quickly
Shakespeare has beguiled another victim with his wordplay.
Macbeth is saying that he hopes this will solve all of his problems. That's what the first "If it were done" suggests. In other words. "If the whole mess will be over when I kill Duncan, then I'd better get at it."
And here's a quote from Interesting Literature to back that up:
Macbeth begins his soliloquy by saying that if the act of killing Duncan would truly be the end of it, and there would be no consequences, it is better to get it over and done with as quickly as possible