The headlamp delay module is just a plug and play add on. I've added it to both of my 97 XJ's. My 87 already had it and it has a very similiar module (looks just like a relay) that if unpluged, yours headlights just function normally with no delay.
The module for the 97+ run about $53 from the dealer. The earlier style should be about the same. I got mine from the junkyard for 2 bucks each.
As for the interior light, while mine doesn't dim, it will shut off on about a 30 second delay -if- you have keyless entry. If you use the keyless entry to unlock the Jeep, the dome lights come on for 30 seconds to allow illuminated access. Locking the Jeep with the keyless shuts off the interior lights.
All you need to do to get the delay exit lighting is is hit the unlock button on the keyless fob when you get out of the Jeep then hit the power lock button on the drivers door before you close it. You will now have 30 seconds before the interior lights shutoff regardless if you still have other doors still open for unloading or even the rear hatch. How to add the dimming at the end of the 30 seconds, I have no idea.