I quite sure one can do this. The only think im not sure of (mainly cause i just woke up and havent given anything much thought yet) is how one would go about running the command.
The code would have to be something like:
If (v1 isin v2) { $read(cat.txt,1) }
Where cat.txt would be the file you have all the writeini's in. You'd just have to ensure that the $read is calling the right command from the correct line.
I can't really tell if this will clean the script up much, but why don't you give it a try.