Is it possible to programmatically enable hotspot mode in iPhone?
You can't create a HotSpot in code talking via an API or via a Configuration Profile
Have you looked at GameKit which does a great job of easing connecting devices transparently via Bluetooth or WiFi? Don't let the "Game" name fool you - it's a great and easy to use library.
If you're willing to put the time and work in to build it, sure.
However, you can only do it for jailbroken phones, and you would need to interface the private API:s. If you still want to do it, a starting point could be to go through the private API:s documented here: https://github.com/nst/iOS-Runtime-Headers