Can an app keep the iPhone's screen from dimming or turning off? So when the app is running the screen won't dim at all or turn off/sleep. If so, how can I go about implementing this in my app in XCode?
UIApplication *app = [UIApplication sharedApplication];
if (!app.isIdleTimerDisabled)
app.idleTimerDisabled = YES;
Most of the time you need this only in one part of your application so you can turn this on and off as you enter/leave that part. For example in -viewDidAppear: and -viewDidDisappear: or whenever you feel you should stop wasting the battery without a proper cause.
Where would I place the code if I wanted to waste the iPhone's battery life for the whole time the app is running? (Don't worry, there is a purpose for it BTW)
That code could be placed anywhere early in your application's life cycle. If you don't know about an iOS application's life cycle yet, now would be a good time to read The Application Life Cycle section of the iOS Application Programming Guide.