Can I get my Google Drive site switched over to Google Sites with it being the same? Can I directly code in Google Sites? If so, how?
Also you could use Google Apps Script
More detailed information in the help articles in references.
From the Google Sites Help