An elected official who received a refund as provided in section 38-804, who is subsequently reemployed as an elected official and who may have redeposited the amount withdrawn with interest as provided in section 38-804 or an elected official who redeems prior service pursuant to statute is subject to the benefits and duties in effect at the time of the elected official’s most recent reemployment. This section does not apply if a court of competent jurisdiction orders reinstatement of benefits and duties under a prior law.