Automating Terminal Commands with AppleScript
These examples accomplish what you want. Note the 
" &amp; quoted form of portName &amp; "
portion of the shellString. Was just guessing that's where it goes, but you can figure it out from there.

-- set the porn name to a variable
set portName to do shell script "ls /dev/tty.usb*"

-- set up the shell command, including the variable you insert
set shellString to "/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avrdude -C /Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf -c arduino -P /dev/tty." &amp; quoted form of portnName &amp; " -p atmega1284p -U flash:w:$HOME/Desktop/Zymatic_RC_1_1_9.hex"

-- run the shell command
do shell script shellString

-- this command returns an alias to a folder
set aFolder to choose folder "Please choose the correct folder"
-- this command returns an alias to a file, you can restrict file types
set aFile to choose file "Please choose the correct file"
-- you can convert the folder/file alias to a string to get just the portion you need