[wallet] Refactor ProcessImport()
[wallet] Refactor ProcessImport()

Summary:
This commit is move-only and doesn't make any functional changes. It
simply moves code around within ProcessImport() in preparation for
refactors in the next commits.

This is a partial backport of Core [[https://github.com/bitcoin/bitcoin/pull/14491 | PR14491]] : https://github.com/bitcoin/bitcoin/pull/14491/commits/a1b25e12a5f57048a4639964d57c0b46eb84cd4e

Some loop variable names have been changed to make sure we don't have shaddowing going on.

Test Plan:
  ninja all check-all

Reviewers: #bitcoin_abc, jasonbcox

Reviewed By: #bitcoin_abc, jasonbcox

Differential Revision: https://reviews.bitcoinabc.org/D6141

cculianu/bitcoin-abc,cculianu/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,cculianu/bitcoin-abc,cculianu/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,cculianu/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,cculianu/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,cculianu/bitcoin-abc,cculianu/bitcoin-abc,Bitcoin-ABC/bitcoin-abc