Question regarding the function pairwiseAlignment in R
According to the help page, it seems more logic to put the reference sequence in subject, and your query sequence in pattern, but it won't really matter for the outcome (except that the pattern sequence will be on top of the alignment).

For your second question: 


  the scores for the optimal pairwise alignments is returned