I think it's better to say "Yes, this is a pen."
"this" is used to identify objects, you have to have an object (i.e. a noun) after it.
"Yes, it is" is more common.
This is similar to possessives.
E.g. You can't say "This is my."
You have to have something after it, like "This is my pen."