What tests can be done to confirm if pain from a nerve is due to scar tissue versus an impingement?

Testing. Disgnostic testing with provocative physical maneuvers to elicit or reproduce the pain, assessing forms tinel's sign or doing a diagnostic nerve block will be helpful.
MRI. If you have undergone spinal surgery and is again experiencing leg pain without a further incident, an evaluation by your spinal surgeon in addition to obtaining a MRI with and without contrast may be able to confirm the nature of the existing pathology.