After looking for something strange in the code and seeing that I'm not able to find anything strange and testing different methods to save pin values in a byte and saving this byte to the EEPROM in the last three days
You'll have to elaborate a little more on what you tested and where the problem is. Is the problem reading the port states and writing the data bits to byte "valores"? That part of your code looks ok to me and think it should work as is. Have you tested reading the EEPROM to see if "valores" is being written to the correct location? You can write a simple seperate sketch to check the values that have been stored in the EEPROM.
While you are in the developing stage its helpful while debugging to enable serial communication and at points in the program print out program state information data which will be displayed in the Arduino IDE's serial monitor window. For example:
Serial.begin(9600); // add this in your setup()
Serial.println(valores, BIN); // add this in your code right after fully populating valores with all the bits.