Here's a single line you can run that'll add the needed line to the file in the correct place for you:
sudo perl -pi -e 's/(pam_smartcard.so)/$1\nauth sufficient pam_tid.so/' /etc/pam.d/sudo