Engines with halflife support should support a func_wall entity with a .skin of -16 to mean 'this is a ladder', and give you physics that react accordingly, which is what I'd recommend for users of the FTE engine (this feature needs no qc changes, of course).
Sadly, this is not the same thing as halflife bsp support, as ladders tend to already have been hacked into various mods in vile horrendous and buggy ways - the pinnacle of which being extrasr4. Which will not work half the time, and leave you stuck in a wall for the rest.
If you want a generic solution that is 100% bug free, prepare for a lot of pain.
Essentually, you need to somehow disable gravity within the ladder area and to exagurate any up/down motion of the player, in order to allow the player free movement up and down the ladder by just looking+moving. Needing to use swimup+swimdown buttons just for a ladder is annoying, especially as people will expect +jump to move up instead, and will forget that swimup+down even exist.
If you want super-hacky-works-anywhere-but-super-lame ladders, then you can create a series of steps instead. 16qu up, 1qu in. at 1qu, the user is unlikely to notice that the ladder is actually steps. However, they will climb the ladder unreasonably fast and thus such 'ladders' should be kept small. These ladders are an easy hack, and do not require any qc or engine changes, can easily be attached to moving trains and platforms and doors and stuff, but they do suck so be aware of that.

.