Since this is my area of expertise, I thought I would add a few things:
If you use a 3rd party coupon (ie GoodRx or any of the others out there), what you pay will NOT go towards your insurance deductible or out of pocket maximum. So if you have other healthcare expenditures and are counting on meeting your deductible/maximum out of pocket, keep that in mind.
If you use insurance, your copay will generally be the same anywhere you go unless:
1. The medication costs less than your copay (this is the example from the OP, where WalMart's cash price is lower than the $10 generic copay from insurance)
2. You have a coinsurance rather than a copay. Coinsurance is based on a % of the cost (ie you pay 10% for generics, 20% for brand, etc.). This is meant for the consumer to feel the price of the drug, rather than "all generics are $10" This would be a case where it would be beneficial to look at the price at different pharmacies. Although, even if you have a copay, the difference in price IS charged on the back end to your insurance company, and eventually comes back around in the form of premium increases. DO NOT start samples of a medication without first checking what the medication will cost once the sample runs out.
If you ever get prescribed a brand name medication, I would always recommend first seeing if there is a more cost-effective generic option to try first (Checking to see if there is a generic of the medication you were prescribed, but ALSO seeing if there is something similar for what you are trying to treat). If you still have to fill a brand name medication, check the manufacturer's website (can usually be reached by going to www.(brand name of your drug).com or doing a quick google search) for a coupon card, most brand name medications will have some form. Do keep in mind, however, that the manufacturer copay assistance may not last forever and you may eventually have to pay the full copay/coinsurance that your insurance charges.
One last thing is that if you are using multiple pharmacies, be sure to inform the pharmacist of all medications you are taking because they will NOT have record of the medications you are filling at a different pharmacy. This will allow the pharmacist to check for the safety and potential interactions of all of your medications.