Detecting which pins are inputs or outputs
What you are trying to do is a bit more complicated than you seem to realize.  For general unknown I/O pins, it looks like you will need two microcontroller pins.  One pin will be a output with maybe 5 k&Omega; in series.  The other pin is a input connected directly to the test chip pin.  This allows you to drive the pin high and low, and to leave it undriven.  But in all cases you can see what the digital level is with the other microcontroller pin.  With this setup, you can detect all the possible digital cases of the pin under test driving high, driving low, or high impedance.

If you stipulate that this test setup is only for digital logic chips and only at the same power voltage as the micrcontroller, then there is no need for analog.

Power and ground pins are another matter, however.  These pins need to be tied solidly high or low during operation.  In the arbitrary case you will need both low and high side switches on every pin since any of them could be power or ground.  This gets messy fast.

I don't want to rain on your idea for a personal project, but frankly this strikes me as quite hard to get right and not much use if you do.  74xxx discrete logic is rarely used nowadays, and when I do need to identify chips I don't find reading the number off the chip all that bad.

How about a capacitor meter?  Those little suckers aren't labeled anymore.