Possible to use Applescript or Automator to authenticate iPhone 5s with my Macbook Pro without entering lockcode on iPhone?
No this is not possible. iOS 11 requires a pincode or password before allowing a computer access to your iPhone.


  With iOS 11, you are required to enter your device passcode before a
  connection with a computer is made, even when the phone is unlocked.
  This is a very nice improvement over the previous "Trust" pop-up.
  
  Now, even if the phone is unlocked with Touch-ID or the new Face-ID,
  connecting to an unknown computer will still require your 4 or 6 digit
  pin code, or the alphanumeric password if you have one set up.


Source