  Twin domains are naturally present in the topological insulator \BiSe{} and
affect strongly its properties. While studies of its behavior for ideal \BiSe{}
structure exist, little is known about their possible interaction with other
defects. Extra information are needed especially for the case of artificial
perturbation of topological insulator states by magnetic doping, which has
attracted a lot of attention recently. Employing ab initio calculations based
on layered Green's function formalism, we study the interaction between twin
planes in \BiSe{}. We show the influence of various magnetic and non-magnetic
chemical defects on the twin plane formation energy and discuss the related
modification of their distribution. Furthermore, we examine the change of
dopants' magnetic properties at sites in the vicinity of a twin plane, and the
dopants' preference to occupy such sites. Our results suggest that twin planes
repel each other at least over distance of $3-4$~nm. However, in the presence
of magnetic Mn and Fe defects a close TP placement is preferred. Furthermore,
calculated twin plane formation energies indicate that in this situation their
formation becomes suppressed. Finally, we discuss the influence of twin planes
on the surface band gap.
