You can start with this little script that I encoded and add some improvements to suit your needs:
"""""the event that will trigger the wrap (leaving insert mode) au InsertLeave * call WrapLines() """""highlight the column where the wrapping will be made set colorcolumn=30 """""WrapLines will be executed on lines function! WrapLines() execute ":%g/^/ call WrapFunction()" endfunction """""check and wrap the line function! WrapFunction() let l:line=getline(".") let l:length=strlen(l:line) let l:occurence=0 let l:i=0 let l:nb=30 for l:i in split(l:line,'\zs') if matchstr(l:i,'"') != '' let l:occurence+=1 let l:occurence=l:occurence % 2 endif let l:nb-=1 if l:nb == 0 break endif endfor if l:length >= 30 if l:occurence == 0 """""to get ^M you need to type <ctrl-v><enter> buttons normal! 30|i^M endif endif endfunction
Note: to get ^M in code, type ctrl + v Enter
Name and save the ex : script.vim and call it after that with the command :source script.vim
Here is an example: ( 30 characters - Limit -):

source share