Delaying action on State Change

You mis-translated this line:

        if (!switchPin) {

to this:

        if (digitalRead (!LinputPin)) {

when what you should have translated it to is:

        if (!digitalRead (LinputPin)) {

With the logical negation in the wrong place it was reading the wrong pin (!4 == !true == false == 0). It was reading pin 0 instead of reading pin 4 and negating it.