Controlling LED light using a limit switch

We know it does not seem to work because you would not be here if it did work. Your sketch does something. What does it actually do?

How are the LED and switch wired? Active-low or active-high?

At first glance those delays seem to be excessive.