In the case of a taxpayer who is entitled to a reduction in federal tax due to the restoration of an item of gross income under section 1341 of the Internal Revenue Code (relating to the computation of tax where the taxpayer restores a substantial amount held under claim of right), there shall be allowed a deduction in determining Idaho taxable income as provided in section 1341(a)(4) of the Internal Revenue Code, if not otherwise deducted by the taxpayer for Idaho income tax purposes. In computing the deduction allowable under this section, no deduction shall be allowed if the item of gross income for a prior taxable year was not included in Idaho taxable income. If the taxpayer has claimed a credit for claim of right income repayment adjustment under section 63-3029F, Idaho Code, then there shall be added to federal taxable income any amount taken as a deduction under section 1341 of the Internal Revenue Code in computing federal taxable income for the tax year.