Something that has helped me to distinguish when to use para and when to use por is the idea of "direction." Use para to indicate that whatever the sentence is saying is directed towards the object of "para".
Tengo este libro para ti. = I have this book for you. (book --> you)
Necesito un lapiz para hacer mi tarea. = I need a pencil to do my homework. (pencil --> homework)
¿Qué tren debería tomar para ir a Marrakech? = Which train should I take to go to Marrikesh? (train --> go)
Use "por" when its object is giving rise to whatever is going on in the sentence.
Podíamos comprar dos kilos por un dólar. = We used to be able to buy two kilos for a dollar. ($1 --> ability to buy)
Gracias por su atención. = Thank you for your attention. (your attention --> gratitude)
Lo conocí por casualidad. = I met him by chance. (chance --> meeting)
A great example of this is the song "Es por tí" by Juanes. Before learning this rule, I thought the song was saying "for you." Instead, it means "because of you," which makes the song much more meaningful for me.
Y es por ti
que late mi corazón = And because of you my heart beats
Y es por ti
que brillan mis ojos hoy = And because of you my eyes shine
Y es por ti
que he vuelto a hablar de amor = And because of you I talk of love again
Y es por ti
que calma mi dolor = And because of you my pain subsides
Of course, this and all other "rules" are just models to predict how a native speaker would talk. They are not laws or morals. The rules don't mould the language. Language just is, and we use rules to try to describe it.
Your "exchange" rule helps to predict when por is used. For me, this "direction" rule works more generally, but even it only describes a part of the difference between para and por.