Hmm ...

Actually, these functions are already defined.  they're called cog-node and cog-link  So you can replace the entire function above by a one-liner:

(define (check-name? node-name node-type) (null? (cog-node node-name node-type)))

If the atom already exists, cog-node will return it. If it does not yet exist, it returns null.