Is it an aspect marker? Is it a specific grammatical construction with 就 or 要是? Is it there just for emphasis? I can't work it out...
了 - is not a verb complement. It's a realis maker, that is, by adding 了 at the end of the verb you render it to reality and not to a probabilistic-theoretical suggestion. So, in OP case, 了 renders possible situation to absolute truth.
你要是喜欢我就给你买 If you like it, I would buy it for you. (talking about possible situation)
你要是喜欢我就给你买了 Your liking is enough for me to buy it. or If you like it, consider the buyng as done (that is, real). (buying for sure, no way back!)
I think the key is the usage of 了. In my opinion, 了 here works like a result complement, which indicates the status changed.
Semantically, they(with or without 了) denote the same meaning.
我买 vs 我买了:
我买 is like saying "I will buy" in English.
我买了 is like "I will have/get it bought. The status changed from not bought to bought.
Another example is 我走 vs 我走了. 我走 is I am going. 我走了 is I will be gone. The status changed from staying here to be gone.
Hope this could help you out.