I see a few issues with your approach,
#!/usr/bin/env ksh
addinfo() {
echo "Please enter your LAST Name: "
read last
echo "Please enter your FIRST Name: "
read first
echo "Please enter your PHONE number as XXX-XXX-XXXX: "
read phone
# Using a while loop on the correct pattern check.
while [[ "$phone" != [0-9][0-9][0-9]-[0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] ]]
do
echo "Please enter your PHONE number as XXX-XXX-XXXX (only): "
read phone
done
echo $last + $first + $phone >> asg7phonebook
}
addinfo