Thank you first of all for replying to my first question. As per the advice I was given in the answers provided, I would like to rephrase my question as follows:

How (and if known, at what stage in evolution) did living creatures develop the ability to avoid noxious stimuli and to move towards attractive stimuli?

Thank you very much !

see original post for "how". Evolution selects for positive survival traits - it is not difficult to imagine how the abilities to sense nutrients would be an advantage and similarly to avoid a noxious/damaging environment.
http://www.askabiologist.org.uk/answers … p?id=13775

single cells organisms definitely exhibit those abilities. Thus the answer would be at least 4 billion years ago.
https://en.wikipedia.org/wiki/Bacteria# … _evolution