Question: In a song I am learning, there is a section of the song that has the chord progression G#m | A#m7b5 | B6
I sometimes get the fingerings wrong and use dimished 7th chords on guitar instead of m7b5 chords and in this case I actually think the dimished7th chord sounds good too. So I wanted to ask, what is the difference functionally between the two? They both seem to work in most situations as leading tone chords to a tonic chord one semitone above (B in this case).

Answer: 
The basic triad (which is what usually gives the main "color" to the chord) is the same, and being a diminshed fifth it creates a lots of tension towards the next one - usually a half tone above, and usually the tonic.

They *are* similar and often interchangeable. While they are not diatonic on both major and minor mode, they can "exist" in those modes:

* in minor mode, the root and seventh of m7b5 are the seventh and sixth melodic degrees ("augmented");
* in major mode, the seventh of dim7 is the harmonic ("lowered") sixth;

The lowered sixth "sounds good" in both modes because it creates a big tension that leads to the fifth, and also due to the fact that it creates another tritone with the third of the chord.

The m7b5 chord is usually considered less powerful than the dim7, as the seventh has less tension towards any resolution, but it can still create interesting effects. The choice depends on the composer/arranger/performer, but it obviously should not collide with any other voice (the melody) and should consider the overall harmony and current harmonic progression.
I don't have much to add to other posts concerning the analysis, however I'd like to point another point. In some cases indeed either diminished and half-diminished chords might provide good harmonization of a melody, however they sound substantially different. If you play one or another randomly, due to mistakes, it might be very confusing for the rest of the band. It is very different from substituting e.g. Cmaj7 with C6, which can be innocent 90% of times.