Not sure if this is intentional or not, but holding spin while becoming airborne (e.g. by jumping or running off an edge) activates his ability.
If you continue to hold spin after twirling into a spring, you'll fall slowly to the ground. D'aw, I guess he's having a fun time letting the wind carry him around!
You can use the ability to cancel hitstun. (Easy fix—disable the ability if P_PlayerInPain(p) is truthy.)
The twirl acts very strangely while inside goop.
The ability can be used while being carried. I guess the defense against the Pterabytes is a cool quirk! (But if you want to fix this, check out p.powers[pw_carry] and the
carry types it can be set to.)
The ability doesn't work very well while wearing a shield. For this reason I think the ability should actually activate on a jump press rather than a spin press; most characters' primary abilities activate on a jump press, but if you
really want to keep it on spin, you should disable shield abilities (which you can do by returning true in a ShieldSpecial hook—it's not currently on the wiki, so seek out some help on Discord if you need assistance).
Also, just a little bit of Lua critique, if you don't mind: p.spinanim seems redundant; you can check whether the player's state is S_PLAY_TWRL instead. PA_ABILITY2 with CA2_MELEE is enough to break both walls and floors, so you don't need to additionally set Bowie's charability to CA_GLIDEANDCLIMB. Because of this, if you let go of spin the tic you touch the ground from a twirl, you enter Knuckles's landing state instead of Amy's, which I would say is undesirable here.