You could start by creating a search off the Customer record and then filtering for Sales Orders within last 7 days and Messages within the last 7 days. This will at least narrow down your window. Then, in the results, you could subtract he Message Date from the Tran Date of the SO.
This is purely theoretical but I think it will work if tran date is also a date/time field.