I have implemented the old JavaScript H.27.x library via custom script GTM tag (with document.write engine enabled) and it works fine. Unfortunately, Google Tag Manager tags are limited to 10,240 characters. My s_code.js script was due to advanced customization much larger. I remember we resolved it by loading s_code library from external script (js file placed on web server).
I would suggest to use Adobe Tag Manager.