Yes, it is possible to write code that either writes code or amends code that is already written. However, I view this capability strictly as a developer tool - nothing that you install on every computer in your company. The reason is that, in order to write code into a project, you need access to that project. You can grant - or deny - such access in the Macro Security dialog box, 'Trusted Publishers' tab, and check/uncheck the box at the bottom that is marked 'Trust access to Visual Basic Project'.
Windows intentionally doesn't provide a method to set this little checkmark programmatically. It has to be done manually. Microsoft argues that, if a program could be used to set this checkmark, hackers could gain access to your VBA Projects and install whatever viruses they just invented directly into the 'brain' of your machine. Windows doesn't open either door or window to that nightmare. The only one who can is yourself. You put that checkmark there at your own risk.
Without such access to the VB Projects code can't be inserted into them. Therefore the practice of creating code on the fly isn't very wide-spread. The risks involved by far outweigh any possible benefits.