What if I spent the focus token to use Blaster Turret and I already have a target lock? I spend my target lock to re-roll. Once it's spent, I get my R4 target lock. Would it work that way?
No. R4 Agromech triggers and is resolved immediately upon spending the focus token. So you can spend the focus to fire (Blaster turret, or Deadeye for ordnance), then use the mech to gain a lock to reroll that attack. But if you already have a lock, you can't defer the gaining effect until after you've spent the lock; it happens immediately.