I'm running into a similar problem as you where I need to create an ugly JDOHelper.getObjectIdAsLong() hack as well due to some legacy Kodo code.
Did you get something fully functional finally? Can you share your plugin? I've looked through the `org.datanucleus.store.rdbms.sql.method.JDOHelperGetObjectIdMethod` implementation, but frankly a little lost by the way it processes everything. I'm a little unclear on the use of a NumericExpression vs an ObjectLiteral, etc.