Help detecting whether or not an NBT tag is a string

For a personal project, I'd like to have a function that takes both an list or a string as input, and if given a string, converts it into a list of one character-long substrings; however, this requires first detecting whether or not that NBT tag is a string in the first place. I've tried using data modify storage pack:temp temp set string *source* *target* *path* 0 0 but that returns an empty string even if it doesn't make sense to. Is there a different way to do this?
Continue to help post