When it comes to writing data scripts the pain is about the same for CE as standard and Express. Count on there being nothing in CE to help you. But you are scripting data from to CE so there might be things in Standard to help.
As far as this goes SQL Server Management Studio can script out table structures for you. You would have to clean up the scripts so that create table statement complies with CE rules. You won't have that many tables for CE. Slightly painful but you can handle that.
Your key comparison technique (what you show in your question) might not matter. What runs scripts in CE is what is important. If you are doing things through management studio you can at least observer what works. Running scripts on a device should be avoided. The tool is so dismal I won't even go into it.
My way around was to write an application that read the data from some file. Then I would look up the row. If it did not exist I would create an INSERT statement. If the row does exist I would create an UPDATE statement.
An alternative technique is to create a DELETE statement for each row and then an INSERT statement as you are pretty sure that the row won't exist but foreign keys might prevent you from deleting some rows.
I know this sounds bad, and it is. We faced the same thing with CE. We had to put all of the smarts into the application doing the data load and using CE only as storage.