First off, note that being weakly $\Pi^1_0$-indescribable is actually the same as being weakly $\Sigma_1^1$-indescribable. Let $\phi(x_0...x_n,S)$ be some formula, say $\exists X(\psi(X,x_0...x_n,S))$, where $\psi(X,x_0...x_n,S)$ is $\Pi^1_0$. Then let $C$ be witness to this, and let $$(\alpha,\beta)=\operatorname{ot}\big\{(\gamma,\zeta)\lt(\alpha,\beta)|\gamma,\zeta\lt\kappa\big\}.$$ Then, $C\times S\subseteq\kappa$, and so, if $$(\kappa,\in,C\times S)\vDash\psi\big(\operatorname{dom}(C\times S),x_0...x_n,\operatorname{ran}(C\times S)\big),$$ then there is some $\alpha\lt\kappa$ such that $$(\alpha,\in, C\times S\cap\alpha)\vDash\psi\big(\operatorname{dom}(C\times S\cap\alpha),x_0...x_n,\operatorname{ran}(C\times S\cap \alpha)\big),$$ and therefore $(\alpha,\in,S\cap\alpha)\vDash\phi(X,x_0...x_n,S)$. You can formalize $\alpha\in \operatorname{dom}(C\times S)$ by $$\exists\beta,X\;\Big(\forall\gamma,\zeta\big(\exists Y(Y=X\leftrightarrow\gamma=\alpha\land\zeta=\beta)\big)\land X\in C\times S\Big).$$ Now, assume to the contrary that $\kappa$ is irregular. Let $C$ be cofinal in $\kappa$, with $|C|\lt\kappa$. Let $\lambda=|C|$. Then $$(\kappa,\in,\lambda,C)\vDash C\text{ is cofinal in }\mathit{Ord}\land\exists x(x=\lambda\land x=|C|).$$ Then, if $$(\alpha,\in,\lambda\cap\alpha,C\cap\alpha)\vDash C\cap\alpha\text{ is cofinal in }\mathit{Ord}\land\exists x(x=\lambda\land x=|C\cap\alpha|),$$ $\alpha\gt\lambda$, and $|C\cap\alpha|\lt\lambda$. But $|C\cap\alpha|=\lambda$. Contradiction. For completeness, I will mention the secondary case. Let $\kappa$ be regular uncountable. Let $M_0$ be the Skolem hull of $\emptyset$ in $\kappa$. Then $|M_0|=\omega$ is less than $(\kappa,\in,S)$, so that $\alpha_0=\text{sup}M_0$ is less than $\kappa$. Then let $M_{n+1}$ be the Skolem hull of $\alpha_n$ in $(\kappa,\in,S)$, and $\text{sup}M_n=\alpha_{n+1}$. Then let $\alpha=\lim_{n\rightarrow\omega}\alpha_n$. **Edit:** It seems that the question is actually asking about how to define the pairing function $(\alpha,\beta)$ in $\kappa$. I am not exactly sure how you could define this.