Improvements to ninja_forms_inner_custom_box()

Removed an unused reference to the global $wpdb;

Improved the $post_id check.

Added esc_attr() to the option value.

Aligned variables.