To avoid repeating yourself, you could do something like:
```python
if xblock.category == 'vertical':
    template = 'studio_vertical_wrapper.html'
else:
    template = 'studio_xblock_wrapper.html'
html = render_to_string(template, template_context)
```