I think there is a possibility to make a program like this produce accurate results when given a text of enough length. But rather than trying to figure out an algorithm, I would simply use a large group of verified people (this is, people you're sure what type they are) and use a neural network to find the patterns.

But one thing is sure: I would restrict it to Socionics.