Code size

OK well...

Your question about 3000 lines of code is kind of undefined.. if each of the 3000 lines just did something really simple, like adding 1 to a number, it would definately finish in time. On the other hand, you could come up with some really crazy code that would take more than a second to execute, but it'd be really complex stuff.

As an example of what you can do in a small amount of time, you can read a position from a GPS unit, log the data to an SD card, and display your position on an LCD screen in well under 1/10th of a second.

In general, the arduino is way fast enough for anything you will do. It runs at 16MHz - that's 16 million instructions per second. That's a LOT of changing output pins, reading input pins etc. Of course there is some overhead with the arduino code, but that is the trade-off between SIMPLICITY and EFFICIENCY.

In regards to your desire to do something at regular intervals, this is a well-used feature. The arduino has a functions built in to do this. They are called interrupts. Definately do some reading of the arduino website and this forum, but bassically when the condition for an interrupt is met; can be a change of pin value like a button being pushed, or like you want to do a defined time period has elapsed, the arduino stops whatever it was doing (i.e. it interrupts) and runs the code you want to run when the condition is met.

People use this extensively in timing sensitive applications, like clocks. An interrupt is set to occur every second. when the interrupt starts, it adds one second to the time.