If they hired that programmer to do the work of a programmer, the automation software would be work-for-hire, and would belong to the company. Since they hired the programmer to do different work, in the absence of an explicit agreement saying otherwise, the automation software belongs to OP, to use (and license) as they please.
If the company owned the software, they could keep OP for occasional maintenance work, even as the other analysts pack up their desk clutter. Since they don't, if they let OP go, OP can just license the software directly to all their analysts without further fear of being fired.
They can all play golf or racquetball or bowling or whatever during the 4.5 days of free time each week that OP can sell to them.