matching patterns inside a condition in awk

I have the following in an awk script. I want to do them on condition that: fext == "xt"

    FNR == NR {
        />/ && idx[FNR] = ++i
        $2 || val = $1
        next
    }

    FNR in idx { v = val[idx[FNR]] }

    { !/>/ && srdist = abs($1 - v) }

    />/ || NF == 2 && srdist < dsrmx { sub(/[ \t]+$/, ""); print }

I have tried using something as below, but am having a problem with the last three commands.

fext == "xt" {

    if (FNR == NR) {
        />/ && idx[FNR] = ++i
        $2 || val = $1
        next
    }

    FNR in idx { v = val[idx[FNR]] }

    { !/>/ && srdist = abs($1 - v) }

    />/ || NF == 2 && srdist < dsrmx { sub(/[ \t]+$/, ""); print }
}

Many of your conditions should be inside if(), e.g.

if (FNR in idx) { v = val[idx[FNR] }