No idea on the longevity of the sketch run… I have a NodeJS one that sometimes quits after a day, other times keeps going for weeks… doing the exact same things all the time.
PS. using the same model of RPi, but running on Ethernet
You can use an interval timer to read then send your data. See an LED flashing example I made, using a few different timers… a single interval timer principle will be the same for your use case