For one thing, don't use copy and paste to move data from one table/record to another. Copy, Paste and the script steps that start with Insert all silently fail to work if the referenced field is not present on the layout and with access permitted in browse mode. If a future layout change alters that, the script can fail when it worked previously. In addition, Copy destroys any data the user may have previously copied to the clipboard, replacing it with the copied ID.
You can avoid this by using Set variable, to copy the value into a variable (instead of the clipboard and then use set field in place of paste to copy the value from the variable to the field of the new related record.
That said, using a script to create a properly linked related record is one of several ways that you can create that related record: http://forums.filemaker.com/posts/e37c1e878a#229064
And have you noticed that your ECG, Blood and SPiro tables have exactly the same structure (one key field, two value fields and a date? If this will be true for all of your examinations, you don't need this third set of tables. You can add an Examination name field to examinations and include the value and date fields in the Examinations table instead of using a third set of related records.
Thanks for the response and the link! I'm trying the Set Variable and it is working well! thanks a lot!
Regarding the examinations, the tables are more complex, i just made this sketch for easy understanding. Each table has between 20 and 120 values, with calculation fields etc...