Anything like fishing line (such as dental floss, & sewing thread) can cut thru tissues like a razor if the animal is unlucky. I sometimes watch online vet shows, & I've seen them do surgery to remove dental floss that someone's cat decided was edible. The vet made a point of saying how that could have cut right thru his internal organs- lucky cat to get a quick diagnosis & surgery- they couldn't just pull it out, so great was the risk that it was caught on tissues. Whether internal or external, fishing line & similar things can cut right thru the body of an animal if it gets hung up just "right". You were lucky...your snake was lucky too.
If you want to hang something, use thick yarn or soft thick rope.And make sure no loops are small enough for a snake to get stuck in- (remember they "gain girth" after eating) same goes for any sort of cage furniture they sell for snakes to hide in & crawl thru. Do not use things sold for tropical fish either; those "castles" & such usually have razor sharp edges left inside that don't seem to impact fish, but a snake that's squishing inside to hide will get sliced & dice.
And a fair # of snakes get stuck in those fake "skulls" used for decoration. You can't trust pet stores to do your thinking for you- it's up to us as "snarents" (snake parents).
When in doubt, don't buy it.
And while I'm thinking of it, also NEVER use any kind of tape in a snake's enclosure...never. Ask me (later) how I know-![]()