Keypad entry in Menu works fine, but is there a better way??

Part of a bigger piece of code where I use int GetTwoNumber(); to collect keypad entries into an integer.
These are used for settings in a menu (LCD) (second piece of code).

Although this works flawlessly, there is one disadvantage here: As long as you are in the "keypad entry stage" or in other words "in the various while loops" the main loop is stopped until I am finished with the data entry.
My main program is not that time sensitive (reefcontroller), and can handle some time not executing code, but isn't there another way to accomplish the same without blocking the main loop? I have looked at other angles but so far I cannot get my head around it.

Any input is welcome....

The function for collection keypad entries:

void setup()
{
 //----------------------Get two keypad numbers to int-----------------------------
  int GetTwoNumber()
  {
   int num = 0;
   int i = 0;
   char key = kpd.getKey();
   while( i < 2 )  
   {
      switch (key)
      {
         case NO_KEY:
            break;

         case '0': case '1': case '2': case '3': case '4':
         case '5': case '6': case '7': case '8': case '9':
            lcd.print(key);
            num = num * 10 + (key - '0');
			i++;
            break;
      }
      key = kpd.getKey();
   }
	settime = 1;
	i = 0;
   return num;
  } 
// -------------------------------------------------------------------------------

One small piece out of the loop with one Menu example (now at 12 menu's):

void loop() 
{

//----------------------Step through the Menu's-----------------------------------
  char key = kpd.getKey();
  if(key)								// Check for a valid key during loop
	{
    switch (key) {
	case '#':
	lcd.setBacklight(LED_ON);
	backlightTime = millis();
	if (menuCount < 10) {
		menuCount++;
	} else  {
		menuCount = 1;
	}
	lcd.clear();
	break;
	//default: 
	//	menuCount = 1;
	//	lcd.setBacklight(LED_ON);
	//	backlightTime = millis();	
		}
	}

//---------------------Menu start times for Led channels--------------------------
  if (menuCount == 4)  {
	lcd.setCursor(0,0);
	lcd.print("STARTTIJD LICHT");
	lcd.setCursor(0,3);
	lcd.print("*=VERANDER D=OPSLAAN");
	if (menuCount == 4 && key == '*')  {
		backlightTime = millis();
		lcd.setCursor(0,1);
		lcd.print("RB=");
		printMins(RBledStartMins);
		lcd.print("  NW=");
		printMins(NWledStartMins);
		lcd.setCursor(0,2);
		lcd.print("CW=");
		printMins(CWledStartMins);
		lcd.print("  Bl=");
		printMins(BlueledStartMins);
		lcd.setCursor(3,1);
		lcd.blink();
		settime = 0;
		while (settime == 0)  {				// use GetTwoNumber function to
			RBsetHR = GetTwoNumber();		// store two keypress in integer
			}
		backlightTime = millis();
		lcd.moveCursorRight();
		settime = 0;
		while (settime == 0)  {
			RBsetMN = GetTwoNumber();
			}
		backlightTime = millis();
		lcd.setCursor(3,2);
		settime = 0;
		while (settime == 0)  {
			CWsetHR = GetTwoNumber();
			}
		backlightTime = millis();
		lcd.moveCursorRight();
		settime = 0;
		while (settime == 0)  {
			CWsetMN = GetTwoNumber();
			}
		backlightTime = millis();
		lcd.setCursor(13,1);
		settime = 0;
		while (settime == 0)  {
			NWsetHR = GetTwoNumber();
			}
		backlightTime = millis();
		lcd.moveCursorRight();
		settime = 0;
		while (settime == 0)  {
			NWsetMN = GetTwoNumber();
			}
		backlightTime = millis();
		lcd.setCursor(13,2);
		settime = 0;
		while (settime == 0)  {
			BluesetHR = GetTwoNumber();
			}
		backlightTime = millis();
		lcd.moveCursorRight();
		settime = 0;
		while (settime == 0)  {
			BluesetMN = GetTwoNumber();
			}
		lcd.noBlink();
		}
	 if (menuCount == 4 && key == 'D')  {		// Check input on value
		if ((RBsetHR >= 0 && RBsetHR <= 23) && (CWsetHR >= 0 && CWsetHR <= 23)
			&& (NWsetHR >= 0 && NWsetHR <= 23) && (BluesetHR >= 0 && BluesetHR <= 23)
			&&(RBsetMN >= 0 && RBsetMN <= 59) && (CWsetMN >= 0 && CWsetMN <= 59)
			&& (NWsetMN >= 0 && NWsetMN <= 59) && (BluesetMN >= 0 && BluesetMN <= 59))
			{
			RBledStartMins= (RBsetHR*60) + RBsetMN;
			CWledStartMins= (CWsetHR*60) + CWsetMN;
			NWledStartMins= (NWsetHR*60) + NWsetMN;
			BlueledStartMins = (BluesetHR*60) + BluesetMN;
			clearLCD(1);
			clearLCD(2);
			lcd.setCursor(4,2);
			lcd.print("OPGESLAGEN");
			backlightTime = millis();
			}
			else  {
			clearLCD(1);
			clearLCD(2);
			lcd.setCursor(1,2);
		    lcd.print("INGAVE VERKEERD!");
			backlightTime = millis();
			}
		 }
  }
// -------------------------------------------------------------------------------
 
}