Couldn't you have a simple "edited" flag and only recompile the sketch if it's been updated since the last compilation?