This can be done with either regex+substitute or macros
Substitute. This is the same as your regex except the important parts are surrounded by \( . \) to create capture groups. These are referred to by submatch(1) and submatch(2) respectively. We use the replace expression \= and execute('let') idiom. Finally, use /n to prevent substitution from ...
Define a list of all the lines you want to insert, and then insert them with either append() or setline(). You'll also need to extract the current indentation.
PS: half a year is almost the time we spent on validating our snippet plugins...
Use :execute to assemble a command from a string, which allows you to include the contents of a variable or return value from a function.
This should work:
execute "winpos 1241 ".ypos
execute "winpos 1241 ".getwinposy()
the system I am working on, its very very difficult if not impossible to get pluggins so I have to do stuff through my vimrc or other method. Basically trying to get a plugin installed could take half a year.
Please note that you don't need to install plug-ins system wide and they can live completely inside your home directory (under ~/.vim more exactly.
There are two <para> because you apply v:count1 to every tag you render. Try this:
" apply v:count1 to the outside tag
put =repeat(s:DocbkRenderTag(a:tag), v:count1)
" render single tag here
for incl_tag in include
let incl_result .= ...