List Drush specific add ons, plug ins, extensions, or modules to use drush dl in automated script
I would personally lean towards simply installing with -y. Adding -y onto the command you've listed will return Y accepting the default on any prompt that comes up (like the one you mention).

drush dl drush_extras -y

If you still want to check if it’s installed, you can check if the directory exists,

if [ -e $HOME/.drush/drush_extras ]; then
  # some logic here
fi 


This won’t help you if the directory is empty though.

Another option is checking the output of 

drush someCommand -h


Where someCommand is a command provided by drush_extras. You can compare the output of a valid one to an invalid one. If they match, it’s not installed.