It seems that easy, doesn't it.
Maybe, one day. But currently, microcontroller technology doesn't work in this "record & play back" kind of way. Yes, you could train a neural network to produce the same outputs on the same inputs as some chip in an AE1 - theoretically. But theoretically, a lot is possible that in practice is kind of challenging to do.
I guess you could get somewhere if you:
* Pick a simple camera model; i.e. the first generation that had any chips in them at all.
* Pick a model for which you have the complete manufacturer service manual so the entire system is specified in detail, including signal conditions and requirements.
* Have a solid basis in embedded systems design.
* Have a couple hundred to a few thousand hours to spare.
Given a population of 7+ billion, you might say that the above will eventually materialize, and that's also the only reason why I don't dismiss the idea out of hand.
This is not to brag, but to clarify why I'm a bit skeptical. I have a decent amateur working knowledge of microcontrollers and have done many projects involving the full process from requirements identification, electrical engineering, manufacturing, embedded software engineering etc. One thing that's always exceedingly difficult is trying to 'hack into' existing systems, although I've done so on occasion (i.e. reverse engineering a very simple Chinese remote controlled relay array because I really liked how the remote handled). The general consensus if you ask around among electronics enthusiasts is to just gut the device, pick out the components you want to re-use and start over. The equivalent in camera terms would be to leave critical components like light meter, solenoids/magnets, LCD's and buttons in place and then start building your own control hardware to tie it all together. The complexity of such a project far exceeds the realistic value of it; seriously, just chuck the damn thing in the garbage and wait for Pentax to launch their new models!
One of the easiest projects I did (not really a 'project') was the addition of a small microcontroller to a Sigma lens with a Canon mount that refused to work on modern Canon EOS cameras:
https://tinker.koraks.nl/photography/potato-potato-making-an-old-sigma-lens-work-on-every-eos-body/ This 'project' ended up consisting of not much more than recreating the work of someone else, but in doing so, I also retraced their steps in reverse engineering the lens mount protocol and analyzing the software they ended up writing. Because the work was already done, this cost me just a few hours of desk research. Because the Canon EOS system uses a bog standard SPI interface, this saved the original inventor countless hours of reverse engineering the lens/camera communication. Because all that's needed in this hack is to literally flip one single bit in one particular bit sequence, it's something that can realistically be done.
What you're proposing is orders of magnitude more complex than the tiny example above. Scale up the flipping of a single bit on a single communication line on a single type of camera to basically substituting the entire controls of a complex camera system... It's not impossible. It's just a little more difficult than I suspect you imagine it to be.