How to add a LED to be triggered for 5 seconds without blocking any other code

When the led is switched on, you set a timer.

In the loop(), you check regularly if the timer has expired (your 5 seconds) and, if so, switch the led off.