This is something I've always done. Thought it might be worth sharing.
After painting a room, pour some of the paint in a glass jar. Mark the lid with the color and the room you painted. Then, if you ever need to touch up some small nicks or scratches, it's very easy to just open the jar and put a dab of paint wherever you need it.