Android - Is there a way to force an app to remain running in the background no matter what?
The accepted answer turned out incorrect or outdated. The "App Settings" module for the Xposed app allows you to specify on a per app basis to keep apps from being killed or freed:
http://repo.xposed.info/module/de.robv.android.xposed.installer
http://repo.xposed.info/module/de.robv.android.xposed.mods.appsettings
Responsible care should of course be exercised when playing with apps changing such low level behaviour.
Simple answer: No. Android always uses OOM (Out-Of-Memory) prioritizing to free unused memory. You can change the priorities of apps (at least until reboot) with some task managers but even then if the memory runs low, apps in the background start getting killed.
Think about this scenario: you've downloaded a badly coded app which runs on boot, causes a buffer overflow and hogs all your memory. Normally, this app is killed, but if it's set to stay open it effectively bricks your phone until reboot, and after that starts again, and again, etc.
Some timers use services with high priorities to avoid this problem, but if you launch enough high-performance, resource-hogging apps while the timer is in the background, it will eventually get killed.