Since nobody actually explained your error properly:
Your while test != len(string): is never True as you keep appending to the original list so the list just keeps on growing and growing until eventually you run out of ram/memory, you should not iterate over and append to the same list, you would need to make a copy or just create a new empty list and append to that.
The list starts with 6 elements, you append 2 more before you test your condition again and increase test by 1 so after the first loop you now have 8 elements in your list and test is 1, next loop you have 10 and test is 2 and so on until you run out of memory...
There are better ways but if you were to use a loop and insert into the original list you would start at the third element and use a step of 3:
string = ['a', 'b', 'c', 'd', 'e', 'f']
for i in range(2, len(string)+2, 3):
string.insert(i, " ")
print (string)
['a', 'b', ' ', 'c', 'd', ' ', 'e', 'f']
You can also use itertools.chain and catch the extra empty spaces at the end with ind < len(string) - 1:
from itertools import chain
print(list(chain.from_iterable((ele, " ") if ind % 2 and ind < len(string) - 1 else ele
for ind, ele in enumerate(string))))
['a', 'b', ' ', 'c', 'd', ' ', 'e', 'f']