Some "dumb" terminals have a built-in setup menu, sort of like "BIOS settings" for a terminal. Those settings will usually include a selection of keyboard layouts. But a Heathkit terminal (which model?) may be too old-school for that. Even if the terminal has a mechanism for switching keyboard layouts, it is unlikely to offer a Colemak layout, as that layout was developed in 2006 or so.
agetty - or any getty process - is started by init (or whatever is PID #1) to initialize the TTY device and send the appropriate reset codes to the terminal, display a login prompt and receive the username. Once getty has done that, it will exec() a login process to get a password from the user.
But note: that is just exec(), not a fork()+exec(). So once its job in starting the session is done, the getty process will be gone, replaced by login and eventually by the user's shell. Once the user's session ends, init will detect that there is no longer any process on that TTY device, and will start another instance of getty to start the process over.
So, if you want to keep filtering any characters coming in from the terminal, you'll need something that stays in place for the entire session. Once the user's session ends, you may want your process to die away, so you can have init start a fresh instance for the next login session.
You'll also need to duplicate the TTY device interface, as the real serial port TTY device will be occupied by your program while it's doing its job. Trying to have two separate programs reading the same serial port simultaneously will only lead to grief. Fortunately, you don't have to do it from scratch: duplicating the TTY interface is exactly what the pseudo-TTYs are for. See man 3 openpty.
You would need to do the initialization of the device settings and sending the appropriate reset codes to the terminal just like agetty does, but then your program would present the login prompt and initialize its character filtering loop. Once it has received a response to the username prompt, it should request a pseudo-TTY, fork()+exec() a login program connected to the "slave" side of that pseudo-TTY, and start passing filtered characters from the real terminal into the master side of that pseudo-TTY and unfiltered output from the pseudo-TTY back to the real terminal.
Your program should not waste CPU cycles by actively waiting for data from the TTY devices, but instead use the select(2) or poll(2) system calls to efficiently wait for data to process.
Reading the source code of the ttysnoop package might be useful, as it needs to do something similar to record the TTY session.