Since the output of the grep command is fixed format, you don't need to do a numeric sort.
Use 'tail' to save only the last 10 lines of the sorted output, then the low sequence is the first entry of the output file, and the high sequence is the last.
Code:
grep sequence input.trc |sort |tail -10 >temp.data
#get low sequence number
low=`head -1 temp.data |cut -c37-41`
high=`tail -1 temp.data|cut -c37-41`
restore archivelog low sequence $low high sequence $high