Using is a verb in using them because it has an object, which nouns cannot take.
Writing is a noun in normal writing because it has an adjective, which verbs cannot take.
Because gerunds are verbs, it makes no sense to ask whether a word is “a gerund, a verb, or some other part of speech.”
A gerund is a kind of verb. It is a non-finite inflection of a verb. It does verb things, like take adverbs and arguments.
- Quickly calling the police was the smartest thing you ever did.
The word calling is a gerund. You can see that it is obviously a verb because it has an adverb modifying it and the police as its direct object. It does not here have a subject, although it could. That subject if a pronoun would normally be the oblique form:
- Him calling the police quickly was the smartest thing he ever did.
- You calling the police quickly was the smartest thing you ever did.
But with a regular noun the object and subject form is the same:
- Your mother quickly calling the police was the smartest thing she ever did.
But sometimes people use a possessive form for the subject of a gerund clause:
- His calling the police quickly was the smartest thing he ever did.
- Your mother’s calling the police quickly was the smartest thing she ever did.
In all cases, calling remains a verb. You cannot do noun things do it. Gerunds are verbs.
Gerund clauses, however, are themselves noun phrases, but that’s something else. You probably don’t want to call the entire constituent a “noun”, but you can certainly call it a noun phrase.
Calling a noun phrase a noun because it can be the subject of a clause just like nouns can be the subject of a clause falls into the same class of error as thinking that nouns modifying nouns are “acting as adjectives” because they are modifying nouns. Socrates would be displeased. :)
One thought: All this part-of-speech assignment and detection of higher level syntactic relations is something that folks in the NLP (natural language processing) community have been doing for a long with the field of Computational Linguistics. You probably want to use their work instead of creating your own. And honestly, this seems like a remarkable lot of work just to prove a point about how to pick names for things in a computer program.