I know there's a certain word for it in an actual English dictionary that I seem to have forgotten. But what is a person called when they do favors for people only because they want something in return?
You're looking for a "name" for that person, aren't you?
How about calling him/her a sycophant?
A person who acts obsequiously towards someone important in order to gain advantage.
M-W puts it a bit more bluntly:
a servile self-seeking flatterer
Note that this was not the original meaning of the word.
Also note that this word is to be used chiefly in cases where the person doing the favor(s) is in a somewhat inferior position (in relation to, say, you).
If you want to sound more formal, you could say that someone is looking for a quid pro quo:
Quid Pro Quo
- something that is given to you or done for you in return for something you have given to or done for someone else.
in politics nobody does something for nothing: there's always a quid pro quo involved
A less formal alternative is tit for tat:
- with an equivalent given in retaliation, as a blow for a blow, reparteé, etc.: He answered their insults tit for tat.
You could say that the person has an Ulterior Motive:
- If you say that someone has an ulterior motive for doing something, you believe that they have a hidden reason for doing it
I would describe someone like that as mercenary: http://www.dictionary.com/browse/mercenary
adjective 1. working or acting merely for money or other reward; venal.
The synonym altruistic in this link is pretty much the exact opposite of what you are looking for.
I'll scratch your back if you'll scratch mine would indicate the measure of reciprocity that the OP alludes to in the stated interactions between two people.
I'll scratch your back if you'll scratch mine:
Idiom -- "You do a favor for me and I'll do a favor for you; if you do something for me that I cannot do for myself, I will do something for you that you cannot do for yourself". (The Free Dictionary)