Is it valid to select a model based upon AUC? I have plot ROC for several models.  These models were used to classify my samples into 2 classes.
Using these commands, I can obtain sensitivity vs. specificity plots for each model:
perf <- performance(pred, "sens", "spec")
plot(perf)

Should I rely on the area under the curve (AUC) for each model to conclude which model is better?  Other than AUC, should we consider other results so as to conclude which model is better?
If yes, how to get AUC with R? Am I right in assuming that "the smaller it is the better is the classification power of the model?"
 A: AUROC is one of many ways of evaluating the model -- in fact it judges how good ranking (or "sureness" measure) your method may produce. The question whether to use it rather than precision recall or simple accuracy or F-measure is only depending on a particular application.
Model selection is a problematic issue on its own -- generally you should also use the score you believe fits application best, and take care that your selection is significant (usually it is not and some other factors may be important, like even computational time).
About AUC in R -- I see you use ROCR, which makes nice plots but it is also terribly bloated, thus slow and difficult in integration. Try colAUC from caTools package -- it is rocket fast and trivial to use. Oh, and bigger AUC is better.
A: As, mbq wrote, the answer to whether you should use AUC depends on what you are trying to do.  Two points that are worth considering:
AUROC is insensitive to changes in class distribution. It places even emphasis on the different classes, which means it can poorly reflect an algorithm's performance if there is a big imbalance in the distribution of classes.  On the other hand, if you are more interested in identifying characteristics of the classes rather than their prevalence, this is a strength. 
AUROC does not capture the different costs of different outcomes and it is seldom the case that you care equally about false positives and false negatives.  
I find AUROC sensible.  The curves easy to read: they are like an intuitive version of a confusion matrix.  But it is important to know what we're reading and what's left off.
See also: Evaluating and combining methods based on ROC and PR curves
A: As you are using ROCR, you can get the point of the ROC curve that maximizes the area and use this to determine the corresponding threshold:
my_prediction <- predict.gbm(object = gbm_mod, newdata = X, 100)
pred <- prediction(my_prediction, Y)
perf <- performance(pred, 'tpr', 'fpr')

r <- rev((as.data.frame(perf@y.values)*(1-as.data.frame(perf@x.values)))[,1])
threshold <- as.data.frame(perf@alpha.values)[which(r==max(r)),1][1]

You can think of this optimization simply as the point that makes the largest possible rectangle under the ROC curve.
