Relay Controlled Door with Limit switches.

tuffyt:
You're right about that but this code will consist of two parts.
Part 1 : Login screen with password protect
Part 2: If password correct, run this code.

so i have not used in setup() for load bitmaps.

OK... move the following code to the end of setup()

  setdoorstate();
  myFiles.loadBitmap(150, 120, 256, 256, "stop.raw");
  myFiles.loadBitmap(540, -10, 256, 256, "ust.raw");
  myFiles.loadBitmap(540, 245, 256, 256, "alt.raw");
  myFiles.loadBitmap(115, 400, 305, 61, "logo.raw");

Get rid of the while (true) and its terminating right curly brace.
When you write your login stuff, place it in a separate function and call if from just before the code you just moved.. After the return from your login function, decide whether to proceed with the rest of the code, allow a retry for the login, or just use a while(true) {} to stop processing any of your other code until a reset happens.

Alternatively, move the above code into a function that you call after the login at the end of setup(), if the login was successful.