You can only claim the repayment as credit IRC 1341 Claim of Right using the TurboTax desktop editions in Forms mode on Form 1040 Line 73d. The amount calculated is entered in the Other Credits and Payments Smart Worksheet Line D.
For calculating the credit use Method 2 in IRS Publication 525 Taxable and Nontaxable Income on page 34 - https://www.irs.gov/pub/irs-pdf/p525.pdf#page=34