1. The usual way to test for the GUI is
:if has('gui_running')
rather than
:if &term == 'builtin_gui'
which, however, should work too.
2. 'termguicolors' can be on even in a terminal emulator which doesn't
support strikethrough or undercurl: it just means that your terminal
understands #RRGGBB color codes (where each of these letters
represents a hex digit), though maybe only for background and
foreground. IMHO you should not rely of it.
3. I notice that in my gvim 8.0.1203 with GTK2 GUI running in GUI
mode, t_Ts and t_Te are defined as ^[|4c and ^[|4C respectively, so I
suppose that the test for has('gui_running') is superfluous. (In the
same executable running as "vim" in a konsole terminal, they are ^[[9m
and ^[[29m respectively.)
The above give the following simplified test:
:if has('patch-8.0.1038') && &t_Ts != '' && &t_Te != ''
Best regards,
Tony.