The FAQ specifies that you can't trade after rolling a 7 and before movingTo quote the robber. In fact you can't do anything at that time (other than talk to people).FAQ:
Q: After rolling a “7,” can I still trade with another player or blackmail him before moving the robber?
A: Trading: No. (...)
After This is to prevent players from using a trade to save themselves from the robber. After moving the robber, you can do whatever you want: build, trade, play development cards... just like any other turn.