An automation tool that provides a set of template entities that simplify complex entity setups, various automation scripts that can generate intermediate entities and apply workarounds for known issues, an entity-based template instancing system, and an optional scripting language that enables additional customizations and the ability to create your own template entities.
MESS is a Half-Life (GoldSource) level compile tool that can automate various tasks. It comes with a set of template entities such as mtl_trigger_random, mtl_trigger_counter, cs_trigger_roundstart, and more, which simplify complex entity setups by presenting them as a single entity. It also contains various automation scripts, one of which lets you use 'target patterns' like "+door1" and "train -> newpos", which will automatically generate intermediate entities like trigger_relay and trigger_changetarget.
Underneath all of this is an entity-based template instancing system that lets you insert both other maps and local templates, and a scripting language that can be used for basic things like randomizing the scale and angles of instances, or for advanced things like the creation of custom template entities and automation scripts.
See the official website for a setup guide, tutorials and more information. Check the download page for Windows 32-bit and Linux 64-bit versions (the ModDB download is the Windows 64-bit version).