この回答が、ご要望に即しているかわかりませんが ...
tex.stackexchange.com に newenvironment for tcolorbox and lstlisting という同様のお悩みの質問を見つけました。
ただ、Answer には 「he tcolorbox manual section 4.13 p 302」とありますが、
古いマニュアルの情報のようですでの tcolorbox のマニュアルかコマンドラインで texdoc tcolorbox で listing only
を検索してみてください。
現在は「17.5 Option Keys of the LIB listings Library」の 335 ページ以降のようです。
上記情報に合わせて lstlistings を sourcebox を利用した形で修正してみましたので参考にしてください。