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.
了 is used to indicate completed status, contrast with the current situation.
你要是喜欢我就给你买 If you like it, I would buy it for you. (If you don't like it, I wouldn't buy it.) 你要是喜欢我就给你买了 If you like it, I would have bought it for you. (You don't like it so I didn't buy it.)
It's there for emphasis purpose, the sentence will have the same meaning even without 了. If translated to English, it would be something like this:
If you like it, I'll just buy it.
If you like it, I'll buy it.
了【le】 (aux.v) used after the verb or adj. to indicate completion (int) 1.To strong affirmation 2.To promote or discourage