How much should a mass air flow sensor cost me?

It doesn’t sound to me like you got ripped off. You can’t really compare prices from sites like Rockauto to an OEM part that the shop purchased for you and installed. It is perfectly normal for a shop to markup parts at least somewhat and an OEM part isn’t the cheapest route to begin with. In addition, there was probably a diagnostic charge for discovering that the MAF was indeed the problem (also normal).