New ones are not programmed, so you would have to get the dealer to flash your truck after installing which would be $80-120. If you buy used, any year '03-'07 will work, but you need to make sure the correct programming is on it. If you can find a used '03 one on Ebay it should work. I found an '04 one on Ebay for $100 and will be getting it reprogrammed by Innovative Diesel soon for performance gains.
Make sure it is the FICM that is bad though before you spend the dough. They are mis-diagnosed quite a bit when there are other problems like glow plug module going bad or wire chaffing issues are pretty common. Check all your injector wiring and make sure nothing has rubbed through to the conductor anywhere.