Go to MP’s setup >> install screen, then plug in the USB cable to the autopilot and check the status message that appears just below the grey/green progress bar. It should display, “Found board type 9 brdrev 0 blrev 4 fwmax: xxxxx chip xxxx” if the “fwmax” number starts with “2” (e.g. “2080768”) then the board is fine. If it starts with “1” then it has the 1MB flash limit.
The Pixhawk 2.x boards are all F4s though so I think you won’t realistically be able to run scripts on it. Sorry for the bad news. Perhaps we could make the wiki more clear although it does talk about needing a “High powered autopilot”.
Reduce SCR_HEAP_SIZE and you may get results. F4 boards don’t have much room left these days with added features over time. If you want to do anything meaningful with scripting, it’s probably time to move to H7 boards.