Programming a genetic algorithm with a non-fixed size
There are plenty of possibilities:


Add/remove a symbol at the end with probability $c$.
Add/remove $k$ symbols at the end with probability $c \cdot 2^{-k}$.
For every symbol, remove it with probability $c_1$;
for every gap, insert a symbol with probability $c_2$.
For every symbol $a$, convert it to $a^k$ with probability $c \cdot 2^{-k-1}$.


And so on and so on. Basically, whatever works for you is good. Without any knowledge about the function you are trying to optimise, it is impossible to guess which strategies make more sense than others.