A lot of engines prefer to just ignore the complexities of stairs, and use a slope for collision instead - I would suggest making a collision only version of your building, with minimal polygons and slopes instead of stairs. If you use that for collision, it's faster, far less likely to stick, easier to negotiate slopes than stairs etc.
I would probably just use a shorter capsule or a sphere for the bottom half of the character, rather than a capsule or sphere that is the same height. You could even just change your collision version of the building, so it allows for the torso height - like, if you have an area that you don't want the player to jump in, you make the ceiling shorter, so the collision sphere will hit the roof where the players head would be... so as far as your game is concerned, the player is a sphere. If the sphere is 3 feet diameter, and the player is 6 foot tall, and the roof is 8 foot tall, then the actual roof on your collision mesh would be 5 foot tall (leaving 2 foot for jump space).
The code is dark and full of errors