HTML is not ASH. HTML is understood by your browser, and ASH is understood by KoLmafia. You cannot freely mix the two. A relay script is written in ASH, and outputs HTML to your browser via the write() and writeln() commands.
If you try to include HTML in your ASH script without it being in quotes, it will definitely generate errors.
write("<head>head stuff, such as scripts included</head>");
write("<body>page content, such as CLI-ified links</body>");
<more ash commands>