I would like to understand the mechanism by which a particular variable is selected as the basis for a decision stump in Adaboost. Does this happen randomly? If so, a given variable may well appear more than once as the basis variable for the decision stump.

Also, with Adaboost, we are assigning higher weights to the misclassified instances from using one weak learner, but then using those higher weights to train on a totally different decision stump. This doesn't make sense to me, since the new weak learner is likely to misclassify different instances.

Finally, what happens if we have 20 variables, but 40 iterations in Adaboost. Since a decision tree is deterministic, will we have 2 identical trees for each variable in the Adaboost model?

"Feature selection", as you describe it, boils down to fitting a depth 1 decision tree on a set of data. Given such a set and weights associated with each, the problem of fitting a decision tree (a stump) involves finding the "best" variable $x$ and threshold $s$, where the best variable and split threshold are defined as the pair that minimizes some measure of node impurity, like the Gini index. If you are unfamiliar with the process of fitting a decision tree, there are lots of resources around the internet. Here is one example.
So, given a set of candidate variables to split on and a set of training data, there will be a unique solution (a single variable and threshold) that is the best depth 1 decision tree for the current boosting stage. In that sense, there is no randomness. However, the set of variables $X=\{x_1, x_2, \dots \}$ that we can pick our split variable from may be either the entire set of features we have, or it can be a (random) subset. Many implementations of decision tree classifiers will enable the fitting algorithm to randomly pick up a subset of variables at each branching phase. For example, in sklearn's DecisionTreeClassifier, this is governed by the max_features parameter.