After you create the new event in newcalevent.php, you need to send the event details (including the id) back to the main page using DayPilot.Modal.close():
var eventdata = {
id: ...,
start: ...
// ...
};
DayPilot.Modal.close({event: eventdata, ...});
This object will be available in onClosed as args.result.event so you can use it to create the new event:
modal.onClosed = function(args) {
dp.clearSelection();
var data = args.result;
if (data && data.result === "OK") {
dp.events.add(new DayPilot.Event(data.event));
dp.message(data.message);
}
};