OLD wall timer Model E1020 ticks really loud
You probably can't get the existing mechanical timer to operate any quietier, since it's old and likely starting to wear out. You can either swap the timer out for a new automatic digital timer, or install a standard single pole switch in its' place.
I believe the code you refer to regarding the fan having to be wired onto a timer switch was a local requirement from many years ago.
Some local jurisdictions have impossed more stringent requirements, but frankly, having an exhaust fan is normally a good idea. If the fan is vented into the attic space, it can cause some serious problems in cold weather with condesation of the warm, moist exhaust air.
Building Code requires that bath fans be piped/vented to the outside of the house and not into the attic space.
There are newer preset timer switches that will turn on the exhaust fan for a fixed amount of time, based on which button you push. These are great as they will run the fan long enough to remove condensation from showers, etc.
If you're going to replace the timer, disconnect or turn off the breaker or power to the switch. Then simply install a new timer or switch by connecting the black supply wire to the bottom of the single pole switch, or to one of the black leads of the timer. Then connect the black wire going to the fan to the top screw on the single pole switch, or the other lead on the new timer. The white (neutral) wires should already be connected with a wire nut inside the box. Connect the ground wire to the ground wire in the box and if the switch box is metal, attach the ground wire to the box with a green grounding screw too.
You can now operate the fan with either a manual on/off switch or the new digital timer, whichever you chose to install.