Yes, all this can be done in BAS.
You can Wrap it in a Loop and specify the Number of times of Attempts to enter another Login.
Naturally, in the Loop there must be a Check Condition if and if it is true, then by Condition breac, stop the Loop at this point and continue further.
I translate via Google Translator.