Is there any difference between 我给你不买 and 我不给你买?
First, 不 and 没有 are different, please read
What is the difference between 不 and 没?

The rule of 不 'in front of the preposition' doesn't always apply to 没有

As your examples indicated 

Both "我在商店没有买很多东西" and "我没有在商店买很多东西" are valid sentences

As for 我给你不买 vs, 我不给你买: 我给你不买 doesn't follow the rule of '不 in front of the preposition' and therefore , is invalid

You can say 我不买电脑给你 or 我不给你买电脑 (both mean "I don't buy computer for you") , but not 我给你不买电脑.