I am currently working on a pcb that uses smd atmega 328p (au). I will be powering it through a lipo battery and a ldo regulator for 3.3v input. I am using the multiwii flight controller code. I know that atmega runs at 8mhz at 3.3v and 16mhz at 5v without overclocking the chip. The question is that should I use the internal 8mhz oscillator or external 8mhz? I will definitely make the chip more accurate as given in some forums but still does this effects anything or not?
If the 8 MHz oscillator is off by a handful of percentage points, it will affect timing measurements you make using millis() and micros(). It could affect the baud-rates of Serial or SoftwareSerial. If these are not of any concern, the only remaining difference would be how fast your code can be executed. It's unlikely that the code pushes the chip runs so close to its maximum capability that it would matter, even at ~8 MHz.
... I just want to know if clock frequency effects the code and if I need to change code a bit like for example blink sketch runs at different time intervals on 8mhz and 16mhz(I tested it).
If you do nothing else, then yes, millis() will appear to run at half speed. You need to add a board definition to the IDE for an Arduino Uno running at 8 MHz. Then millis() and micros will be adjusted for the slower processor clock. How you do this depends on whether you choose the internal and less accurate 8 Mhz oscillator, or an external 16 MHz crystal.
For the internal oscillator, there is a board-definition on Github with instructions to load it into your IDE.
For an external oscillator, this article describes how to select the board type as "Arduino Pro or Pro Mini" and then be able to select the board frequency, using the Tools menu twice.