The thing with your solution is that it only avoids pipeline execution when you have a merge request event, but there still will be duplicate pipelines, e.g. merge-request pipelines (the detached ones) and branch pipelines (others), also when pushing a tag your setup will create a separate pipeline I think.
Following the docs you can avoid duplicate pipelines and switch between Branch- and MR-Pipelines when using the following rules-set for workflow (I added the || $CI_COMMIT_TAG) since when pushing a tag also a pipeline should be created (but maybe only a few jobs will be added into this pipeline)
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS'
when: never
- if: '$CI_COMMIT_BRANCH' || '$CI_COMMIT_TAG'
this pipeline is a merge-request pipeline, you can see this because it's detached and because of the Merge-Request Symbol and the number of the MR on the left hand side of the commit id

The following screenshot shows a 'normal' branch-pipeline, which is denoted by the branch-name and the GitLab branch symbol on the left of your commit id
