How are the servos powered ? Have you got any pullup resistors on the buttons to stop spurious inputs caused by electrical noise ? Do the values output by your Serial prints show the X and Y values stepping or do they they go straight to the correct values ?
Sounds like that should be an array to me, and look at the example on this page http://www.cplusplus.com/reference/cstring/strtok/ to see how to get a series of values using strtok() in a while loop. Add a counter inside the while loop and use it as an index to an array in order to save the variables extracted from the string.
Actually it leaves you with a String called string which is not the same thing at all.
If it were a C style string (a char array terminated with a null) then I would suggest that you use strtok() to parse it into its elements and atio() to convert parts of it to integers . See http://gammon.com.au/serial for how to collect the incoming bytes in a string.
There are strong feelings here as to whether Strings should be used on a microcontroller with limited RAM and strings are regarded by most as a better alternative so expect different opinions on the subject.
In your original code you are not clearing the value of the val variable at the start off the loop() function so once it is set it does not change until another value is entered. Incidentally, after entering 'e' and letting the servo move and return, then entering 'r' will do nothing as the servo is already at position 30
Attach the servos once in setup() and don't do it in loop()
If one of the servos is moving in the wrong direction then change the number that you write to it until it moves in the correct direction. Write a simple program that does nothing but attach one servo and write to it. Experiment with the value written until you get what you want then use the value in your main program.
The pass array should be null terminated in order that it can be recognised as a C style string. You have declared it with a size of 5 and the password is 4 characters long so you have room for the null in the array. Add the null to the array after you increment index and before you try to print any array element or the whole array.
pass[index] = kpd.getKey();//store character in buffer one by one Serial.println(index); index++;//increment index pass[index] = 0; //add the null terminator Serial.print(pass[index]);