scpi: style nits in sr_scpi_scan(), prefer common helper
Improve readability and simplify maintenance of the sr_scpi_scan()
routine.
Move initial assignment and subsequent update of variables in closer
proximity, don't hide assignments in declaration blocks. Use common
helper code where available. Split complex conditions into individual
terms which are easier to review and reason about. Don't mix calls and
value checks and flow control in the same statement.