OK, so you should be using RegExp instead of SNC.regex, you still have the incNumber variable in there even though it's not being used and you have 2 query lines in your glide record matching the same field but to different values, this will obviously never return any results as the same field can never match 2 different things!

var reg = new SNC.Regex(numberPattern); //you should be using RegExp
var matchedNumber = reg.match(email.subject);
var incNum= sub.substring(inc,inc+10); //this is no longer needed if you're using regex

if (JSUtil.notNil(matchedNumber)) { //you don't need this, you can do the query in the glide record
var incidentRec = new GlideRecord("incident");
incidentRec.addQuery("number", matchedNumber);
//incidentRec.addQuery('number',incNum); //you can't have 2 different queries on the same field matching on different things
incidentRec.query();

You seem to be matching on a reference of ##12345##, this doesn't look like the number format of a service now incident. What is this reference?

The script below will find that reference in a subject line and search for any related incidents but the condition on the inbound action is looking for 'INC' so if your ticket reference is ##12345## it's not going to match that condition

gs.include('validators');

var regex = new RegExp(/#{2}[0-9]{5}#{2}/);
var incNumber = regex.exec(email.subject);

var gr = new GlideRecord('incident');
gr.addQuery('number', incNumber);
gr.query();
if(gr.next()) {
	
if(email.subject.toLowerCase().indexOf("worknotes") >= 0){
gr.work_notes = "reply from: " + email.origemail + "\n\n" + email.body_text;
gr.update();
event.state="stop_processing";
}
else{
gr.comments = "reply from: " + email.origemail + "\n\n" + email.body_text;
gr.update();
event.state="stop_processing";
}
}