If a vacancy shall happen in the representation of this state in the United States senate, it shall be filled at the general election next succeeding the happening thereof, unless such vacancy shall happen within thirty days next preceding such election, in which case it shall be filled by election at the second succeeding general election, unless the governor of this state shall deem it advisable to call a special election therefor, which he is authorized hereby to do.The governor of this state may make a temporary appointment of a senator of the United States from this state whenever a vacancy shall occur by reason of any cause other than the expiration of the term; and such appointee shall serve as such senator until a special election or general election shall have been held pursuant to law and the board of state canvassers can deliver to his successor a certificate of election.
In your case of him running, getting defeated and resigning, then the resignation occurred after the election, not before and within 30 days of the election as specified in the above cited law.... Thus a replacement can be appointed for his resignation for the remainder of the unexpired 107th term which is all he was elected to serve . The Senator for the 108th which was the election the Torch lost under your senario was elected and thus takes his seat on Jan. 3, 2003.
The vacancy did not "within thirty days next preceding such election", so that part of the statue does not apply. But the first sentence sure would (if this law could ever be interpreted to cancel/overturn an election...which it cannot).