Why did my LGA-ORD flight make an S-shaped turn round the time it was passing a storm?
I find it hard to believe that this was a holding pattern of some sort.


Believe it. An hour before landing would be about the point at which the aircraft will start its descent to its destination. Almost certainly, air traffic control were delaying your flight for a few moments to ease insertion into the landing pattern at Chicago. Doing this at altitude burns less fuel than waiting until the aircraft is lower down.

The storms were incidental. Had the pilots been avoiding the weather they'd have diverted north or south and then resumed their route. A large S-bend wouldn't be necessary.