The interior lights in our '97 Expy did the same thing when we first picked it up. You'll notice the "door ajar" switches on the Expy aren't the usual "push button" type you used to see on cars (I noticed this the first time when I was working on something with the door open and tried to find the button to cut off the light).
Anyway, one of these sensors isn't sensing the door is closed. Try to figure out which one by noticing which door is open before the problem occurs (this may take some time to determine if it isn't the driver's side front door- since this door is presumably opened each time you take the truck somewhere). The fault in ours was the rear driver's side door. Our Ford dealer fixed the problem (I'm trying to remember how... I think he pried up the sensor cover- he DID say that spraying WD-40 down into the sensor area usually does the trick).
Good luck! BTW, the reason the lights sometimes stay on for a long time is because there is an automatic light cutoff even if the door is left ajar. Also, to really check if this is the cause, pay attention to the dash panel when the lights stay on... if the sensor is the problem, you will see the "Door Ajar" light shining.
I had a friend of mine that had the same issue. However, it was always after his wife drove the truck. After thinking about it for a minute or 2 I thought about the interior switch for the lights (the turn up or down the interior lights on the dash). In the up position, all the lights (including the running board lights) would come on.
When she would get into the truck, she was somehow hitting the switch and turning the lights on.
Prob not the case here, but worth a look (cheap repair).