Using Spigot or Bukkit is one option to run that you mean (scripts). Other option is Mohist, which works for run Forge mods and Spigot plugins at the same time in your server.
If you wanna optimize but let your server be more vanilla, i recommend you to use Spigot and just install plugins like ClearLagg or a TPS optimization plugin.