I plan to desolder the infrared diode from my raspberry-pi to add a 30cm long wire to it and solder it again. Do I need to solder the pre resistor right next to the infrared diode?
1. Resistor in series to fix the current
There is no such need. The resistor will impact the amount of current in the line wherever it is.
A 30cm wire it's okay but, if a wire gets much longer, it will automatically increase the resistance of the line and then lower the current (due to the inner resistance of the wire). For a longer wire, you would have to recalculate the resistor's value.
2. Pull down resistor
There is no real difference in the placement of that resistor as well. But you just in case, put it close to the GPIO.
In any case, keep the resistor on the board. It's easier to solder than on a wire anyway