Upvote:3
Yes it certainly is possible to construct an itinerary via Dublin on the way back to the US. However, none of the major alliance carriers nor their interline feeders operate a direct service on Dublin-Ibiza; therefore it will involve another stop at an intermediate point in Europe (where will depend on which airline alliance you use). Because of the way most transatlantic fares are now structured, this should not materially affect the ticket price.
Most of the NYC terminals now have the new "Automatic Passport Control" [APC] machines and I have found (as a non-US Passport holder) that entry times have been significantly reduced.
I am not sure it is worth a detour through Dublin purely to avail yourself of pre-clearance.