32 KB in a microcontroller is a lot of program memory. 1,000 lines of code is likely to assemble down to a few kilobytes, and all the Arduino libraries are likely to still be bigger than your program.
If I recall, I don't think any of the ATMegas support having external program memory. If you have something like a large lookup table, you could get an I²C EEPROM and load it into there.
As for the PC/Raspberry Pi, some sort of I/O board for the computer is likely to cost much more than an Uno or Mega, ditto with the Raspberry Pi, especially if you need analog inputs or PWM.
I would say, for now, stick with the Uno, but keep any pins you use as #defines
, that way, if you do run out of program ROM, you could easily port it over to the Mega.