As the old saying goes, "don't buy a sick (damaged, impaired) creature out of pity, it will only end in heartbreak". Hypocrite that I am, I quote this having done it myself, and I assure you it often ends badly. Still, it's hard to resist wanting to help some small creature, isn't it? So good for you for trying to give him a better life or at least make him comfortable.
As mentioned above, the disorientation can take a few days to work out because of going from a tiny environment to a much larger one. That's definitely what the hiding behind the filter thing is about; every betta I've ever had did this for anywhere from 1-7 days at the beginning.
As well as the above suggestions, something else occurs to me. Do you have any plants in the tank, or decor? It's possible that he's seeing too many reflected surfaces and is confused by bombarding light and other fish (himself reflected - no matter how much distraction we put in there, they will always find a way to catch sight of themselves and see it as a challenge). This would include the bottom. By that I mean, having substrate (gravel pref, or sand). Fish see differently than us, and it's possible he's living in a hall of mirrors.
Even though it's a small tank, a plant or two will help establish anchoring space and provide a place to hide. Silk or living plants are best for bettas, as plastic can shred their fins.
Bettas also appreciate the Betta Log, which serves as a safe hiding spot, bedroom, etc. Last year I had to evacuate due to a hurricane and took my lone betta in his own 1 gallon travel tank. That's pretty small, but it accommodated his log and favorite plant (the same color as himself, blue - he LOVED that plant for the camouflage). He did just fine with his security items.
Bettas have big personalities and excellent brains. He is capable of recognizing and becoming attached to you. So on top of everything else you read here, it is possible to help him by bonding - getting close and talking to your new friend.
__________________
|