#A, and #B are constants used to check bit flags from the Button() command. Button() and #A for instance will be 0 if [A] is not pressed and a non zero value otherwise. So you want a different variable like say ret$. The other problem is you are asking users to type in two values. You don't want that. Instead ask for one variable then check that against "A" or "B" to get the right course of action
on lines 15 and 16 you need to check if the result is "A" or "B". The repeat should be before the input so you loop until you get a valid response. Don't want then player sending garbage to your code.