You don't return a column "ScriptId" from your query:
string sql = "Select Max(ScriptId) from tbl_Script";
SqlCommand cmd = new SqlCommand(sql, conn);
using (var reader = cmd.ExecuteReader())
{
if (reader["ScriptId"] == System.DBNull.Value)
You return a count, which will have no name instead.
But there are a couple of other things here you need to look at:
1) You don't need a reader to return a count: any single value return can be done with an ExecuteScalar instead of ExecuteReader.
2) Your code is wide open to nasty intermittent bugs which are very hard to track down. Remember you are working with SQL which is designed as a multi-use4r system: so it is very easy for a different PC to "get in" and use the same ID value you are trying to. Don't "read the highest value and add one" - that is a recipe for your app falling over in production, but working perfectly in development. Consider using either an Identity column, or a Guid column instead.