How can I ask for input and then pass the variable in terminal?

These lines will prompt for your username and password:

echo -n 'Username: '
read username

echo -n 'Password: '
read -s password #The -s means silent, so your password is not shown in the terminal.

You can then use the variables $username and $password in the rest of your script, like this:

osascript -e 'tell app "System Events" to keystroke "'"$username"'" & tab & "'"$password"'"'