I assume each product has a weight value, right? Is your shipping rule calculating the shipping cost based on the total weight of all items in the basket?
If that's the case then doesn't that mean that the weight calculation is already being carried out? You just need to create a session variable, or something similar, and then store that session variable value in the database.
Sorry if I've misunderstood your request.