Simple script editing text files and running commands

Okay this will probably have multiple parts to it but I don't really want to trouble you guys with more help because I'm a total noob so I can just do the first part by hand (it's just editing a few hundred lines of text in a file; I have to do the same thing on each line and I'm sure there's a scripted solution for it but I can spare a couple hours).

So basically I have a file with several hundred lines, and each line is only 2-3 words.

I need the script to do these things in order:

1) kill process1
2) put the 1st line of this file list into already existing text file #1 (requires root to write): the line it needs to write to is like: "option LINE1" where the 1st line has to be written where 'LINE1' is, somewhere in this text file
3) save this text file
4) put the 1st line of this file list into existing text file #2: the line is like "set = { opt1 = LINE1; opt2 = LINE1; opt3 = LINE1; }" and again I want the 1st line to be filled in all where 'LINE1' says
5) save text file
6) start process1
7) run a certain command in shell which will execute a CLI program and leave it running (I don't think it can be run in the background because I tried starting it with the '&' sign at the end and it ran but it didn't connect the way it properly was supposed to)
8) repeat but use the next line in the file list

What programming language would be the quickest and easiest way to write something like this? If it's not shell scripting, sed/awk, etc. please move this thread to the appropriate programming section. It doesn't have to be fancy or anything, just work even if it's dirty

i think Perl is a good choice for this task

Okay, I decided to make it a bit simpler, and with bash scripting it seems shorter. I have this so far:

#!/bin/bash
killall process1
#editing configs
process1 &
sleep 5
process2

The #editing configs part is the only part left. So this is what I need to get this script to do now:

The large file is in this format:

apple
banana
candy
...
[several hundred lines of this]
yoyo
zebra

1st config file:

option WORD1
otheroption blaha
moreoption blahb

2nd config:

name = { john }
colors = { red,blue }
options = { opt1 = WORD1; opt2 = WORD1; opt3 = WORD1; }

I need the instances where it says 'WORD1' in both config files to be edited and replaced with the line I choose from the large file list. So say I want the word 'candy' to be placed where 'WORD1' is, I would run the script with the number '3' because 'candy' is the 3rd word in the list. But if I run the script again though (in a new terminal window), I have to make sure that 'candy' is replaced by the next word/line I choose because I can't have it hanging around from my previous use of the script.