slorf,
Since the file does not conform to INI rules, you cannot use INI APIs like ReadProfileString(). THere are UDFs on this site that will read in the entire file into an array with each line being an element. Simply read in each element (line), writing it out to a new file, until you reach the one where you want to insert. Insert what you want and write the remainder. Rename the original and then remame the new to replace.

Alternately, use one of the many QReplace utilities available and replace the line where you want to insert with the new line plus the existing line. How hard can it be?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.